Remove ParserGetVariableVarCacheHook, deprecated in 1.35

This exposed internal cache mechanisms of the Parser, and appears
to have been originally added in c08da372bc
but is unused in any code indexed by codesearch.

Bug: T236813
Change-Id: Iaa5da572d76b1d396ecc7e3d3eb29c8d7d4bcddd
This commit is contained in:
C. Scott Ananian 2022-08-12 13:09:39 -04:00
parent 694982e62b
commit d57c6ddcce
6 changed files with 3 additions and 40 deletions

View file

@ -392,6 +392,8 @@ because of Phabricator reports.
* $wgCanonicalNamespaceNames no longer includes custom namespaces defined using
$wgExtraNamespaces. Extensions should use the NamespaceInfo service instead
of accessing this configuration setting directly.
* The following hook, deprecated in 1.35, has been removed:
- ParserGetVariableValueVarCache: ParserGetVariableValueVarCacheHook
* These methods have been moved from IDatabase to IMaintainableDatabase:
- IDatabase::fieldExists -> IMaintainableDatabase::fieldExists
- IDatabase::indexExists -> IMaintainableDatabase::indexExists

View file

@ -965,7 +965,6 @@ $wgAutoloadLocalClasses = [
'MediaWiki\\Hook\\ParserFirstCallInitHook' => __DIR__ . '/includes/parser/Hook/ParserFirstCallInitHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueSwitchHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueSwitchHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueTsHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueTsHook.php',
'MediaWiki\\Hook\\ParserGetVariableValueVarCacheHook' => __DIR__ . '/includes/parser/Hook/ParserGetVariableValueVarCacheHook.php',
'MediaWiki\\Hook\\ParserLimitReportFormatHook' => __DIR__ . '/includes/parser/Hook/ParserLimitReportFormatHook.php',
'MediaWiki\\Hook\\ParserLimitReportPrepareHook' => __DIR__ . '/includes/parser/Hook/ParserLimitReportPrepareHook.php',
'MediaWiki\\Hook\\ParserLogLinterDataHook' => __DIR__ . '/includes/parser/Hook/ParserLogLinterDataHook.php',

View file

@ -45,7 +45,6 @@ class DeprecatedHooks {
'LocalFile::getHistory' => [ 'deprecatedVersion' => '1.37' ],
'MagicWordwgVariableIDs' => [ 'deprecatedVersion' => '1.35', 'silent' => true ],
'PageContentSave' => [ 'deprecatedVersion' => '1.35', 'silent' => true ],
'ParserGetVariableValueVarCache' => [ 'deprecatedVersion' => '1.35' ],
'ParserSectionCreate' => [ 'deprecatedVersion' => '1.35' ],
'ParserTestTables' => [ 'deprecatedVersion' => '1.36', 'silent' => true ],
'PrefixSearchBackend' => [ 'deprecatedVersion' => '1.27', 'silent' => true ],

View file

@ -287,7 +287,6 @@ class HookRunner implements
\MediaWiki\Hook\ParserFirstCallInitHook,
\MediaWiki\Hook\ParserGetVariableValueSwitchHook,
\MediaWiki\Hook\ParserGetVariableValueTsHook,
\MediaWiki\Hook\ParserGetVariableValueVarCacheHook,
\MediaWiki\Hook\ParserLimitReportFormatHook,
\MediaWiki\Hook\ParserLimitReportPrepareHook,
\MediaWiki\Hook\ParserLogLinterDataHook,
@ -2907,13 +2906,6 @@ class HookRunner implements
);
}
public function onParserGetVariableValueVarCache( $parser, &$varCache ) {
return $this->container->run(
'ParserGetVariableValueVarCache',
[ $parser, &$varCache ]
);
}
public function onParserLimitReportFormat( $key, &$value, &$report, $isHTML,
$localize
) {

View file

@ -1,26 +0,0 @@
<?php
namespace MediaWiki\Hook;
use Parser;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "ParserGetVariableValueVarCache" to register handlers implementing this interface.
*
* @deprecated since 1.35
* @ingroup Hooks
*/
interface ParserGetVariableValueVarCacheHook {
/**
* Use this hook to change the value of the variable
* cache or return false to not use it.
*
* @since 1.35
*
* @param Parser $parser
* @param array &$varCache Variable cache
* @return bool|void True or no return value to continue or false to abort
*/
public function onParserGetVariableValueVarCache( $parser, &$varCache );
}

View file

@ -2842,10 +2842,7 @@ class Parser {
* Some of these require message or data lookups and can be
* expensive to check many times.
*/
if (
$this->hookRunner->onParserGetVariableValueVarCache( $this, $this->mVarCache ) &&
isset( $this->mVarCache[$index] )
) {
if ( isset( $this->mVarCache[$index] ) ) {
return $this->mVarCache[$index];
}