See the discussion starting at T221174#5439782
Description
Details
Related Objects
- Mentioned In
- T240054: Move top level namespace from Parsoid to Wikimedia\Parsoid
T204618: Permit aria-hidden="true" in Sanitizer
T238845: Call to a member function serialize() on null
T235273: Remove PHPUtils::jsSort routine (or make it no-op) once Parsoid/JS is retired
T242746: Update ParsoidExtensionAPI to be a coherent and functional extension API to aid extension implementations
T244413: PHP Warning: Use of undefined constant PAGE_UNAVAILABLE - assumed 'PAGE_UNAVAILABLE' (this will throw an Error in a future version of PHP)
T244412: PHP Warning: A non-numeric value encountered
T221174: POST /:domain/v3/transform/pagebundle/to/pagebundle/:title?/:revision? - Mentioned Here
- T204618: Permit aria-hidden="true" in Sanitizer
T235273: Remove PHPUtils::jsSort routine (or make it no-op) once Parsoid/JS is retired
T238845: Call to a member function serialize() on null
T240054: Move top level namespace from Parsoid to Wikimedia\Parsoid
T242746: Update ParsoidExtensionAPI to be a coherent and functional extension API to aid extension implementations
T244412: PHP Warning: A non-numeric value encountered
T244413: PHP Warning: Use of undefined constant PAGE_UNAVAILABLE - assumed 'PAGE_UNAVAILABLE' (this will throw an Error in a future version of PHP)
rGPAR612106d2f3a0: Use extension config option for html2wt formatting of extension tags
T221174: POST /:domain/v3/transform/pagebundle/to/pagebundle/:title?/:revision?
Event Timeline
With some git grep, sed, sort, uniq, etc, here is how Env is being used:
Content version functionality:
$env->getInputContentVersion() $env->getOutputContentVersion() $env->setInputContentVersion( ... ) $env->setOutputContentVersion( ... ) $env->resolveContentVersion( ... )
Properties (some of which are available without going through env)
$env->pageWithOldid $env->topFrame $env->getPageConfig() $env->getPageMainContent() $env->langConverterEnabled()
Document creation and logging. Logging is probably handled using the top level logger. As for document creation, need to investigate what that is being used for.
$env->createDocument( ... ) $env->log( ...)
So, overall, this refactoring might not be too hard.
Change 561441 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Remove $env use from content version resolution functionality
Change 561447 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Eliminate use of env in content version resolution code
The above gerrit patches eliminate all but the first two, and those two are primarily initializations and can be eliminated easily as well.
Actually might require moving some functionality from the API endpoints into src/Parsoid.php interface so that the API endpoints are themselves lean and simply dispatch to the right Parsoid library API method.
Change 561447 abandoned by Subramanya Sastry:
Eliminate use of $env in content version resolution code
Reason:
squashed into parent patch
Change 561441 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Remove Env use from content version resolution functionality
Change 583401 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Move substTopLevelTemplates to the entrypoint
Change 583401 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Move substTopLevelTemplates to the entrypoint
Change 583423 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Stop passing $env to createRedirectToOldidResponse
Change 583424 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Pass PageConfig to createEnv
Change 583425 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Move getPageMainContent from Env to PageConfig
Change 583426 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Stop passing Env to ParsoidHandler::wt2html
Change 583427 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Inline check for null revision content
Change 583450 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Remove titleShouldExist
Change 583451 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Hoist acceptable check
Change 583477 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Stop passing Env to PageHandler::getPageContentResponse
Change 583478 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Add SiteConfig::languageConverterEnabledForPage
Change 583479 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Stop passing Env to "update" methods on ParsoidHandler
Change 583787 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Move downgrades to the entrypoint
Noting so I don't forget. The use of Env in DataAccess::logLinterData is also suspect,
https://github.com/wikimedia/parsoid/blob/master/extension/src/Config/DataAccess.php#L331-L355
Yes, absolutely .. I knew it when that patch landed ... but that one should be relatively easy to fix, it appeared at that time.
Change 583423 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Stop passing $env to createRedirectToOldidResponse
Change 583424 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Pass PageConfig to createEnv
Change 583425 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Move getPageMainContent from Env to PageConfig
Change 583426 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Stop passing Env to ParsoidHandler::wt2html
Change 583427 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Inline check for null revision content
Change 583944 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Stop passing Env to DataAccess::logLinterData()
Change 583450 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Remove titleShouldExist
Change 583451 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Hoist acceptable check
Change 583477 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Stop passing Env to PageHandler::getPageContentResponse
Change 583478 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Add SiteConfig::languageConverterEnabledForLanguage
Change 583479 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Stop passing Env to "update" methods on ParsoidHandler
Change 583787 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Move downgrades to the entrypoint
Change 583944 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Stop passing Env to DataAccess::logLinterData()
Change 584120 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to 0.12.0-a8
Change 584120 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to 0.12.0-a8
Change 607105 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/vendor@master] Bump Parsoid to 0.12.0-a18