aboutsummaryrefslogtreecommitdiffstats
path: root/includes/cache/HTMLFileCache.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2023-05-06 22:01:10 +0200
committerDannyS712 <dannys712.wiki@gmail.com>2023-05-11 06:17:38 +0000
commite04d3a28f6c4341b7185a7f121bdfa90372a43df (patch)
tree54f2337f22977dda7e541a94fbdaf437a7894715 /includes/cache/HTMLFileCache.php
parent9878c4c67a9de08242573f5f5fa149128d80499e (diff)
downloadmediawikicore-e04d3a28f6c4341b7185a7f121bdfa90372a43df.tar.gz
mediawikicore-e04d3a28f6c4341b7185a7f121bdfa90372a43df.zip
Replace internal Hooks::runner
The Hooks class contains deprecated functions and the whole class is going to get removed, so remove the convenience function and inline the code. Bug: T335536 Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
Diffstat (limited to 'includes/cache/HTMLFileCache.php')
-rw-r--r--includes/cache/HTMLFileCache.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php
index d68031bcb437..c19b8f067bdb 100644
--- a/includes/cache/HTMLFileCache.php
+++ b/includes/cache/HTMLFileCache.php
@@ -22,6 +22,7 @@
*/
use MediaWiki\Cache\CacheKeyHelper;
+use MediaWiki\HookContainer\HookRunner;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageIdentity;
@@ -93,7 +94,8 @@ class HTMLFileCache extends FileCacheBase {
* @return bool
*/
public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
- $config = MediaWikiServices::getInstance()->getMainConfig();
+ $services = MediaWikiServices::getInstance();
+ $config = $services->getMainConfig();
if ( !$config->get( MainConfigNames::UseFileCache ) && $mode !== self::MODE_REBUILD ) {
return false;
@@ -125,18 +127,17 @@ class HTMLFileCache extends FileCacheBase {
// Check that there are no other sources of variation
if ( $user->isRegistered() ||
- !$ulang->equals( MediaWikiServices::getInstance()->getContentLanguage() ) ) {
+ !$ulang->equals( $services->getContentLanguage() ) ) {
return false;
}
- $userHasNewMessages = MediaWikiServices::getInstance()
- ->getTalkPageNotificationManager()->userHasNewMessages( $user );
+ $userHasNewMessages = $services->getTalkPageNotificationManager()->userHasNewMessages( $user );
if ( ( $mode === self::MODE_NORMAL ) && $userHasNewMessages ) {
return false;
}
// Allow extensions to disable caching
- return Hooks::runner()->onHTMLFileCache__useFileCache( $context );
+ return ( new HookRunner( $services->getHookContainer() ) )->onHTMLFileCache__useFileCache( $context );
}
/**