diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2020-05-01 21:31:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2020-05-01 21:31:26 +0000 |
commit | e2d7f9b490d0f7fcee3da77e24b637df9480b63e (patch) | |
tree | 066c86a7115ff267ba43dc01c254f039f69282ff | |
parent | 09c182abba94e79c5a14ce27668a7c317225cb71 (diff) | |
parent | 705e7e7c216aa1e8b501d30d5e3ce95559bd2935 (diff) | |
download | mediawikicore-e2d7f9b490d0f7fcee3da77e24b637df9480b63e.tar.gz mediawikicore-e2d7f9b490d0f7fcee3da77e24b637df9480b63e.zip |
Merge "Hard deprecate $wgParser"
-rw-r--r-- | RELEASE-NOTES-1.35 | 3 | ||||
-rw-r--r-- | docs/globals.txt | 3 | ||||
-rw-r--r-- | docs/hooks.txt | 2 | ||||
-rw-r--r-- | includes/Setup.php | 4 |
4 files changed, 8 insertions, 4 deletions
diff --git a/RELEASE-NOTES-1.35 b/RELEASE-NOTES-1.35 index 464149abc251..843fa97b6310 100644 --- a/RELEASE-NOTES-1.35 +++ b/RELEASE-NOTES-1.35 @@ -958,6 +958,9 @@ because of Phabricator reports. * Version 1 of the parserTests file format has been deprecated. Update your parser tests to version 2, which uses Remex tidy on all test output by default. +* $wgParser — This global variable, soft deprecated in 1.32, has now been hard + deprecated. Use MediaWikiServices::getInstance()->getParser() instead. + (T160811) * LinksUpdate::getRevision and ::setRevision are hard deprecated in favor of the new ::getRevisionRecord and ::setRevisionRecord methods. * Article::getRevision and WikiPage::getRevision were hard deprecated diff --git a/docs/globals.txt b/docs/globals.txt index 805362ce0c52..0bb37fda5b96 100644 --- a/docs/globals.txt +++ b/docs/globals.txt @@ -56,7 +56,8 @@ $wgContLang Language object associated with the wiki being viewed. $wgParser - Parser object. Parser extensions register their hooks here. + Parser object. Parser extensions used to register their hooks here; + modern code should use the ParserFirstCallInit hook. $wgRequest WebRequest object, to get request data diff --git a/docs/hooks.txt b/docs/hooks.txt index 1a93cbe4110c..cbf1b3a9f90a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2613,7 +2613,7 @@ $rev: Revision object of the template &$deps: Array of template dependencies with 'title', 'page_id', 'rev_id' keys 'ParserFirstCallInit': Called when the parser initialises for the first time. -[&]$parser: Parser object being cleared +[&]$parser: Parser object being initialised 'ParserGetVariableValueSwitch': Called when the parser needs the value of a custom magic word diff --git a/includes/Setup.php b/includes/Setup.php index 3174f5c1dc1c..377411a0047f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -794,9 +794,9 @@ $wgOut = RequestContext::getMain()->getOutput(); // BackCompat * @var Parser $wgParser * @deprecated since 1.32, use MediaWikiServices::getInstance()->getParser() instead */ -$wgParser = new StubObject( 'wgParser', function () { +$wgParser = new DeprecatedGlobal( 'wgParser', function () { return MediaWikiServices::getInstance()->getParser(); -} ); +}, '1.32' ); /** * @var Title $wgTitle |