Move some hooks to ResourceLoader\HookRunner
- ResourceLoaderGetConfigVarsHook - ResourceLoaderJqueryMsgModuleMagicWordsHook Change-Id: Ifd8fa776655b347cb539ac824426afb12463148a
This commit is contained in:
parent
7dc1ae74fd
commit
d85f9bd2b0
4 changed files with 25 additions and 24 deletions
|
|
@ -3,7 +3,6 @@
|
|||
namespace MediaWiki\HookContainer;
|
||||
|
||||
use Article;
|
||||
use Config;
|
||||
use DifferenceEngine;
|
||||
use File;
|
||||
use IContextSource;
|
||||
|
|
@ -492,8 +491,6 @@ class HookRunner implements
|
|||
\MediaWiki\RenameUser\Hook\RenameUserPreRenameHook,
|
||||
\MediaWiki\RenameUser\Hook\RenameUserSQLHook,
|
||||
\MediaWiki\RenameUser\Hook\RenameUserWarningHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderJqueryMsgModuleMagicWordsHook,
|
||||
\MediaWiki\Rest\Hook\SearchResultProvideDescriptionHook,
|
||||
\MediaWiki\Revision\Hook\ContentHandlerDefaultModelForHook,
|
||||
\MediaWiki\Revision\Hook\RevisionRecordInsertedHook,
|
||||
|
|
@ -3258,24 +3255,6 @@ class HookRunner implements
|
|||
);
|
||||
}
|
||||
|
||||
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
|
||||
$this->container->run(
|
||||
'ResourceLoaderGetConfigVars',
|
||||
[ &$vars, $skin, $config ],
|
||||
[ 'abortable' => false ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onResourceLoaderJqueryMsgModuleMagicWords( RL\Context $context,
|
||||
array &$magicWords
|
||||
): void {
|
||||
$this->container->run(
|
||||
'ResourceLoaderJqueryMsgModuleMagicWords',
|
||||
[ $context, &$magicWords ],
|
||||
[ 'abortable' => false ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onRevisionDataUpdates( $title, $renderedRevision, &$updates ) {
|
||||
return $this->container->run(
|
||||
'RevisionDataUpdates',
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace MediaWiki\ResourceLoader;
|
||||
|
||||
use Config;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
|
||||
/**
|
||||
|
|
@ -14,7 +15,9 @@ class HookRunner implements
|
|||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderForeignApiModulesHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderRegisterModulesHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderSiteModulePagesHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderSiteStylesModulePagesHook
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderSiteStylesModulePagesHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook,
|
||||
\MediaWiki\ResourceLoader\Hook\ResourceLoaderJqueryMsgModuleMagicWordsHook
|
||||
{
|
||||
/** @var HookContainer */
|
||||
private $container;
|
||||
|
|
@ -62,4 +65,22 @@ class HookRunner implements
|
|||
[ 'abortable' => false ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
|
||||
$this->container->run(
|
||||
'ResourceLoaderGetConfigVars',
|
||||
[ &$vars, $skin, $config ],
|
||||
[ 'abortable' => false ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onResourceLoaderJqueryMsgModuleMagicWords( Context $context,
|
||||
array &$magicWords
|
||||
): void {
|
||||
$this->container->run(
|
||||
'ResourceLoaderJqueryMsgModuleMagicWords',
|
||||
[ $context, &$magicWords ],
|
||||
[ 'abortable' => false ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2089,7 +2089,7 @@ MESSAGE;
|
|||
'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
|
||||
];
|
||||
|
||||
( new \MediaWiki\HookContainer\HookRunner( $services->getHookContainer() ) )
|
||||
( new HookRunner( $services->getHookContainer() ) )
|
||||
->onResourceLoaderGetConfigVars( $vars, $skin, $conf );
|
||||
|
||||
return $vars;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use MediaWiki\HookContainer\HookRunner;
|
|||
use MediaWiki\Languages\LanguageNameUtils;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\ResourceLoader as RL;
|
||||
use MediaWiki\ResourceLoader\CodexModule;
|
||||
use MediaWiki\ResourceLoader\Context;
|
||||
use MediaWiki\ResourceLoader\FilePath;
|
||||
|
|
@ -1472,7 +1473,7 @@ return [
|
|||
$magicWords = [
|
||||
'SITENAME' => $config->get( MainConfigNames::Sitename ),
|
||||
];
|
||||
( new HookRunner( MediaWikiServices::getInstance()->getHookContainer() ) )
|
||||
( new RL\HookRunner( MediaWikiServices::getInstance()->getHookContainer() ) )
|
||||
->onResourceLoaderJqueryMsgModuleMagicWords( $context, $magicWords );
|
||||
|
||||
return [
|
||||
|
|
|
|||
Loading…
Reference in a new issue