Page MenuHomePhabricator

Reduce / eliminate Parsoid's knowledge of what mode it is running in (standalone, integrated, offline)
Open, MediumPublic

Description

Parsoid/JS and Parsoid/PHP currently has some knowledge of what mode it is running in.

But, given that Parsoid, the composer lib, has dependencies injected via the entry interface in src/Parsoid,php, only scripts, tools, and production config code needs to know about these modes so they can inject the appropriate objects. Core Parsoid should simply query these objects for information and merrily carry along with its work.

Eliminating that will require some amount of code refactoring and is probably best done while integrating Parsoid/PHP with the core parser. This phab task tracks that work.

T221041: Convert Parsoid to dependency injection is related

Event Timeline

ssastry triaged this task as Medium priority.Jul 31 2019, 7:43 PM
ssastry updated the task description. (Show Details)
ssastry moved this task from Backlog to Non-Porting Tasks on the Parsoid-PHP board.
ssastry moved this task from Non-Porting Tasks to Post-Port Work on the Parsoid-PHP board.
ssastry renamed this task from Reduce / eliminate Parsoid's knowledge of what mode it is running in (standalone, integrate, offline) to Reduce / eliminate Parsoid's knowledge of what mode it is running in (standalone, integrated, offline).Jul 31 2019, 7:46 PM

This currently exists as a noDataAccess flag, which nothing seems to be using. We can probably move that code out to a NoDataAccess instance, as suggested in the comment,
https://github.com/wikimedia/parsoid/blob/master/src/Config/Env.php#L68-L74