- public static function useFileCache( IContextSource $context ) {
- global $wgUseFileCache, $wgDebugToolbar, $wgContLang;
- if ( !$wgUseFileCache ) {
+ public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
+ $config = MediaWikiServices::getInstance()->getMainConfig();
+
+ if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_REBUILD ) {