use MediaWiki\Config\ConfigRepository;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\FileBackend\FSFile\TempFSFileFactory;
+use MediaWiki\FileBackend\LockManager\LockManagerGroupFactory;
use MediaWiki\Http\HttpRequestFactory;
use MediaWiki\Interwiki\ClassicInterwikiLookup;
use MediaWiki\Interwiki\InterwikiLookup;
-use MediaWiki\Languages\LanguageNameUtils;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Linker\LinkRendererFactory;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
+use Wikimedia\Message\IMessageFormatterFactory;
+use MediaWiki\Message\MessageFormatterFactory;
use MediaWiki\Page\MovePageFactory;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Preferences\PreferencesFactory;
);
},
- 'LanguageNameUtils' => function ( MediaWikiServices $services ) : LanguageNameUtils {
- return new LanguageNameUtils( new ServiceOptions(
- LanguageNameUtils::$constructorOptions,
- $services->getMainConfig()
- ) );
- },
-
'LinkCache' => function ( MediaWikiServices $services ) : LinkCache {
return new LinkCache(
$services->getTitleFormatter(),
);
},
- 'LocalisationCache' => function ( MediaWikiServices $services ) : LocalisationCache {
- $conf = $services->getMainConfig()->get( 'LocalisationCacheConf' );
-
- $logger = LoggerFactory::getInstance( 'localisation' );
-
- $store = LocalisationCache::getStoreFromConf(
- $conf, $services->getMainConfig()->get( 'CacheDirectory' ) );
- $logger->debug( 'LocalisationCache: using store ' . get_class( $store ) );
-
- return new $conf['class'](
- new ServiceOptions(
- LocalisationCache::$constructorOptions,
- // Two of the options are stored in $wgLocalisationCacheConf
- $conf,
- // In case someone set that config variable and didn't reset all keys, set defaults.
- [
- 'forceRecache' => false,
- 'manualRecache' => false,
- ],
- // Some other options come from config itself
- $services->getMainConfig()
- ),
- $store,
- $logger,
- [ function () use ( $services ) {
- $services->getResourceLoader()->getMessageBlobStore()->clear();
- } ],
- $services->getLanguageNameUtils()
- );
- },
-
'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff {
$config = $services->getMainConfig();
- $cacheId = \ObjectCache::detectLocalServerCache();
+ $cacheId = ObjectCache::detectLocalServerCache();
+
+ return ObjectCache::newFromParams( $config->get( 'ObjectCaches' )[$cacheId] );
+ },
- return \ObjectCache::newFromParams( $config->get( 'ObjectCaches' )[$cacheId] );
+ 'LockManagerGroupFactory' => function ( MediaWikiServices $services ) : LockManagerGroupFactory {
+ return new LockManagerGroupFactory(
+ WikiMap::getCurrentWikiDbDomain()->getId(),
+ $services->getMainConfig()->get( 'LockManagers' ),
+ $services->getDBLoadBalancerFactory()
+ );
},
'MagicWordFactory' => function ( MediaWikiServices $services ) : MagicWordFactory {
"Cache type \"$id\" is not present in \$wgObjectCaches." );
}
- return \ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] );
+ return ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] );
},
'MainWANObjectCache' => function ( MediaWikiServices $services ) : WANObjectCache {
}
$params['store'] = $mainConfig->get( 'ObjectCaches' )[$objectCacheId];
- return \ObjectCache::newWANCacheFromParams( $params );
+ return ObjectCache::newWANCacheFromParams( $params );
},
'MediaHandlerFactory' => function ( MediaWikiServices $services ) : MediaHandlerFactory {
? $services->getLocalServerObjectCache()
: new EmptyBagOStuff(),
$mainConfig->get( 'UseDatabaseMessages' ),
- $mainConfig->get( 'MsgCacheExpiry' ),
$services->getContentLanguage()
);
},
+ 'MessageFormatterFactory' =>
+ function ( MediaWikiServices $services ) : IMessageFormatterFactory {
+ // @phan-suppress-next-line PhanAccessMethodInternal
+ return new MessageFormatterFactory();
+ },
+
'MimeAnalyzer' => function ( MediaWikiServices $services ) : MimeAnalyzer {
$logger = LoggerFactory::getInstance( 'Mime' );
$mainConfig = $services->getMainConfig();
// 'class' and 'preprocessorClass'
$services->getMainConfig()->get( 'ParserConf' ),
// Make sure to have defaults in case someone overrode ParserConf with something silly
- [ 'class' => Parser::class,
- 'preprocessorClass' => Parser::getDefaultPreprocessorClass() ],
+ [ 'class' => Parser::class, 'preprocessorClass' => Preprocessor_Hash::class ],
// Plus a buch of actual config options
$services->getMainConfig()
);
},
'_SqlBlobStore' => function ( MediaWikiServices $services ) : SqlBlobStore {
+ // @phan-suppress-next-line PhanAccessMethodInternal
return $services->getBlobStoreFactory()->newSqlBlobStore();
},