mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-23 15:57:06 +00:00
Use service framework to access Disambiguator extension, not hard-coded class
The Hooks::isDisambiguationPage() method is deprecated in any case. Change-Id: Id2a10f2f1be0e38ddb8ebef5d5babb3daac3ce9a
This commit is contained in:
parent
71de06a682
commit
703e142c59
|
@ -4,7 +4,6 @@ namespace RelatedArticles;
|
|||
|
||||
use IContextSource;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Extension\Disambiguator\Hooks as DisambiguatorHooks;
|
||||
use MediaWiki\Hook\BeforePageDisplayHook;
|
||||
use MediaWiki\Hook\MakeGlobalVariablesScriptHook;
|
||||
use MediaWiki\Hook\OutputPageParserOutputHook;
|
||||
|
@ -54,8 +53,12 @@ class Hooks implements
|
|||
* @return bool
|
||||
*/
|
||||
private static function isDisambiguationPage( Title $title ) {
|
||||
return \ExtensionRegistry::getInstance()->isLoaded( 'Disambiguator' ) &&
|
||||
DisambiguatorHooks::isDisambiguationPage( $title );
|
||||
$services = MediaWikiServices::getInstance();
|
||||
if ( !$services->hasService( 'DisambiguatorLookup' ) ) {
|
||||
return false;
|
||||
}
|
||||
return $services->getService( 'DisambiguatorLookup' )
|
||||
->isDisambiguationPage( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue