40use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
66 $services->getMainConfig()->get(
'ActorTableSchemaMigrationStage' )
86 $services->getMainConfig()->get(
'CommentTableSchemaMigrationStage' )
92 $registry =
$services->getBootstrapConfig()->get(
'ConfigRegistry' );
95 foreach ( $registry as $name => $callback ) {
96 $factory->register( $name, $callback );
116 $secret = $config->get(
'HKDFSecret' ) ?: $config->get(
'SecretKey' );
118 throw new RuntimeException(
"Cannot use MWCryptHKDF without a secret." );
123 $context = [ microtime(), getmypid(), gethostname() ];
143 'DBLoadBalancerFactory' =>
145 $mainConfig =
$services->getMainConfig();
148 $mainConfig->get(
'LBFactoryConf' ),
154 $instance =
new $class( $lbConf );
168 $config->get(
'ExternalStores' )
176 'HttpRequestFactory' =>
186 $config->get(
'InterwikiExpiry' ),
187 $config->get(
'InterwikiCache' ),
188 $config->get(
'InterwikiScopes' ),
189 $config->get(
'InterwikiFallbackSite' )
203 if ( defined(
'MW_NO_SESSION' ) ) {
204 return $services->getLinkRendererFactory()->create();
206 return $services->getLinkRendererFactory()->createForUser( $wgUser );
219 return \ObjectCache::newFromId( $cacheId );
232 $mainConfig =
$services->getMainConfig();
234 $id = $mainConfig->
get(
'MainStash' );
235 if ( !isset( $mainConfig->get(
'ObjectCaches' )[$id] ) ) {
236 throw new UnexpectedValueException(
237 "Cache type \"$id\" is not present in \$wgObjectCaches." );
240 return \ObjectCache::newFromParams( $mainConfig->get(
'ObjectCaches' )[$id] );
244 $mainConfig =
$services->getMainConfig();
246 $id = $mainConfig->
get(
'MainWANCache' );
247 if ( !isset( $mainConfig->get(
'WANObjectCaches' )[$id] ) ) {
248 throw new UnexpectedValueException(
249 "WAN cache type \"$id\" is not present in \$wgWANObjectCaches." );
252 $params = $mainConfig->get(
'WANObjectCaches' )[$id];
253 $objectCacheId =
$params[
'cacheId'];
254 if ( !isset( $mainConfig->get(
'ObjectCaches' )[$objectCacheId] ) ) {
255 throw new UnexpectedValueException(
256 "Cache type \"$objectCacheId\" is not present in \$wgObjectCaches." );
258 $params[
'store'] = $mainConfig->get(
'ObjectCaches' )[$objectCacheId];
260 return \ObjectCache::newWANCacheFromParams(
$params );
265 $services->getMainConfig()->get(
'MediaHandlers' )
271 $mainConfig =
$services->getMainConfig();
273 'typeFile' => $mainConfig->get(
'MimeTypeFile' ),
274 'infoFile' => $mainConfig->get(
'MimeInfoFile' ),
275 'xmlTypes' => $mainConfig->get(
'XMLMimeTypes' ),
277 function ( $mimeAnalyzer, &$head, &$tail, $file, &
$mime ) use ( $logger ) {
280 if ( $deja->isValid() ) {
281 $logger->info(
"Detected $file as image/vnd.djvu\n" );
282 $mime =
'image/vnd.djvu';
288 'MimeMagicGuessFromContent',
289 [ $mimeAnalyzer, &$head, &$tail, $file, &
$mime ]
292 'extCallback' =>
function ( $mimeAnalyzer,
$ext, &
$mime ) {
296 'initCallback' =>
function ( $mimeAnalyzer ) {
298 Hooks::run(
'MimeMagicInit', [ $mimeAnalyzer ] );
303 if (
$params[
'infoFile'] ===
'includes/mime.info' ) {
304 $params[
'infoFile'] = __DIR__ .
"/libs/mime/mime.info";
307 if (
$params[
'typeFile'] ===
'includes/mime.types' ) {
308 $params[
'typeFile'] = __DIR__ .
"/libs/mime/mime.types";
311 $detectorCmd = $mainConfig->get(
'MimeDetectorCommand' );
312 if ( $detectorCmd ) {
313 $factory =
$services->getShellCommandFactory();
314 $params[
'detectCallback'] =
function ( $file ) use ( $detectorCmd, $factory ) {
317 ->unsafeParams( $detectorCmd )
324 return new MimeAnalyzer(
$params );
354 $config->get(
'CacheEpoch' )
360 $services->getMainConfig()->get(
'ParserConf' ),
371 $config->get(
'PasswordConfig' ),
372 $config->get(
'PasswordDefault' )
376 'PerDbNameStatsdDataFactory' =>
379 $wiki = $config->get(
'DBname' );
391 $services->getLinkRendererFactory()->create()
393 $factory->setLogger( LoggerFactory::getInstance(
'preferences' ) );
399 $mainConfig =
$services->getMainConfig();
401 $mainConfig->get(
'SquidServers' ),
402 $mainConfig->get(
'SquidServersNoPurge' )
423 $renderer->
setLogger( LoggerFactory::getInstance(
'SaveParse' ) );
441 $config->get(
'MultiContentRevisionSchemaMigrationStage' ),
442 LoggerFactory::getProvider(),
443 $config->get(
'ContentHandlerUseDB' )
462 'time' => $config->get(
'MaxShellTime' ),
463 'walltime' => $config->get(
'MaxShellWallClockTime' ),
464 'memory' => $config->get(
'MaxShellMemory' ),
465 'filesize' => $config->get(
'MaxShellFileSize' ),
467 $cgroup = $config->get(
'ShellCgroup' );
468 $restrictionMethod = $config->get(
'ShellRestrictionMethod' );
470 $factory =
new CommandFactory( $limits, $cgroup, $restrictionMethod );
471 $factory->setLogger( LoggerFactory::getInstance(
'exec' ) );
472 $factory->logStderr();
478 $cacheFile =
$services->getMainConfig()->get(
'SitesCacheFile' );
480 if ( $cacheFile !==
false ) {
501 $names =
$services->getMainConfig()->get(
'ValidSkinNames' );
503 foreach ( $names as $name => $skin ) {
504 $factory->
register( $name, $skin,
function () use ( $name, $skin ) {
505 $class =
"Skin$skin";
506 return new $class( $name );
510 $factory->register(
'fallback',
'Fallback',
function () {
514 $factory->register(
'apioutput',
'ApiOutput',
function () {
530 rtrim(
$services->getMainConfig()->get(
'StatsdMetricPrefix' ),
'.' )
544 $services->getMainConfig()->get(
'EnableUploads' ),
549 'VirtualRESTServiceClient' =>
551 $config =
$services->getMainConfig()->get(
'VirtualRestConfig' );
554 foreach ( $config[
'paths'] as $prefix => $serviceConfig ) {
555 $class = $serviceConfig[
'class'];
557 $constructArg = $serviceConfig[
'options'] ?? [];
558 $constructArg += $config[
'global'];
560 $vrsClient->mount( $prefix, [
'class' => $class,
'config' => $constructArg ] );
566 'WatchedItemQueryService' =>
580 $services->getMainConfig()->get(
'UpdateRowsPerQuery' )
584 if (
$services->getMainConfig()->get(
'ReadOnlyWatchedItemStore' ) ) {
591 'WikiRevisionOldRevisionImporterNoUpdates' =>
604 $services->getMainConfig()->get(
'LocalInterwikis' ),
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfGetCache( $cacheType)
Get a specific cache object.
wfIsHHVM()
Check if we are running under HHVM.
return[ 'ActorMigration'=> function(MediaWikiServices $services) :ActorMigration { return new ActorMigration($services->getMainConfig() ->get( 'ActorTableSchemaMigrationStage'));}, 'BlobStore'=> function(MediaWikiServices $services) :BlobStore { return $services->getService( '_SqlBlobStore');}, 'BlobStoreFactory'=> function(MediaWikiServices $services) :BlobStoreFactory { return new BlobStoreFactory($services->getDBLoadBalancerFactory(), $services->getMainWANObjectCache(), $services->getMainConfig(), $services->getContentLanguage());}, 'CommentStore'=> function(MediaWikiServices $services) :CommentStore { return new CommentStore($services->getContentLanguage(), $services->getMainConfig() ->get( 'CommentTableSchemaMigrationStage'));}, 'ConfigFactory'=> function(MediaWikiServices $services) :ConfigFactory { $registry=$services->getBootstrapConfig() ->get( 'ConfigRegistry');$factory=new ConfigFactory();foreach( $registry as $name=> $callback) { $factory->register( $name, $callback);} return $factory;}, 'ConfigRepository'=> function(MediaWikiServices $services) :ConfigRepository { return new ConfigRepository( $services->getConfigFactory());}, 'ConfiguredReadOnlyMode'=> function(MediaWikiServices $services) :ConfiguredReadOnlyMode { return new ConfiguredReadOnlyMode( $services->getMainConfig());}, 'ContentLanguage'=> function(MediaWikiServices $services) :Language { return Language::factory( $services->getMainConfig() ->get( 'LanguageCode'));}, 'CryptHKDF'=> function(MediaWikiServices $services) :CryptHKDF { $config=$services->getMainConfig();$secret=$config->get( 'HKDFSecret') ?:$config->get( 'SecretKey');if(! $secret) { throw new RuntimeException("Cannot use MWCryptHKDF without a secret.");} $context=[microtime(), getmypid(), gethostname()];$cache=$services->getLocalServerObjectCache();if( $cache instanceof EmptyBagOStuff) { $cache=ObjectCache::getLocalClusterInstance();} return new CryptHKDF( $secret, $config->get( 'HKDFAlgorithm'), $cache, $context);}, 'CryptRand'=> function() :CryptRand { return new CryptRand();}, 'DBLoadBalancer'=> function(MediaWikiServices $services) :Wikimedia\Rdbms\LoadBalancer { return $services->getDBLoadBalancerFactory() ->getMainLB();}, 'DBLoadBalancerFactory'=> function(MediaWikiServices $services) :Wikimedia\Rdbms\LBFactory { $mainConfig=$services->getMainConfig();$lbConf=MWLBFactory::applyDefaultConfig($mainConfig->get( 'LBFactoryConf'), $mainConfig, $services->getConfiguredReadOnlyMode());$class=MWLBFactory::getLBFactoryClass( $lbConf);$instance=new $class( $lbConf);MWLBFactory::setSchemaAliases( $instance, $mainConfig);return $instance;}, 'EventRelayerGroup'=> function(MediaWikiServices $services) :EventRelayerGroup { return new EventRelayerGroup( $services->getMainConfig() ->get( 'EventRelayerConfig'));}, 'ExternalStoreFactory'=> function(MediaWikiServices $services) :ExternalStoreFactory { $config=$services->getMainConfig();return new ExternalStoreFactory($config->get( 'ExternalStores'));}, 'GenderCache'=> function(MediaWikiServices $services) :GenderCache { return new GenderCache();}, 'HttpRequestFactory'=> function(MediaWikiServices $services) :\MediaWiki\Http\HttpRequestFactory { return new \MediaWiki\Http\HttpRequestFactory();}, 'InterwikiLookup'=> function(MediaWikiServices $services) :InterwikiLookup { $config=$services->getMainConfig();return new ClassicInterwikiLookup($services->getContentLanguage(), $services->getMainWANObjectCache(), $config->get( 'InterwikiExpiry'), $config->get( 'InterwikiCache'), $config->get( 'InterwikiScopes'), $config->get( 'InterwikiFallbackSite'));}, 'LinkCache'=> function(MediaWikiServices $services) :LinkCache { return new LinkCache($services->getTitleFormatter(), $services->getMainWANObjectCache());}, 'LinkRenderer'=> function(MediaWikiServices $services) :LinkRenderer { global $wgUser;if(defined( 'MW_NO_SESSION')) { return $services->getLinkRendererFactory() ->create();} else { return $services->getLinkRendererFactory() ->createForUser( $wgUser);} }, 'LinkRendererFactory'=> function(MediaWikiServices $services) :LinkRendererFactory { return new LinkRendererFactory($services->getTitleFormatter(), $services->getLinkCache());}, 'LocalServerObjectCache'=> function(MediaWikiServices $services) :BagOStuff { $cacheId=\ObjectCache::detectLocalServerCache();return \ObjectCache::newFromId( $cacheId);}, 'MagicWordFactory'=> function(MediaWikiServices $services) :MagicWordFactory { return new MagicWordFactory( $services->getContentLanguage());}, 'MainConfig'=> function(MediaWikiServices $services) :Config { return $services->getConfigFactory() ->makeConfig( 'main');}, 'MainObjectStash'=> function(MediaWikiServices $services) :BagOStuff { $mainConfig=$services->getMainConfig();$id=$mainConfig->get( 'MainStash');if(!isset( $mainConfig->get( 'ObjectCaches')[$id])) { throw new UnexpectedValueException("Cache type \"$id\" is not present in \$wgObjectCaches.");} return \ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches')[$id]);}, 'MainWANObjectCache'=> function(MediaWikiServices $services) :WANObjectCache { $mainConfig=$services->getMainConfig();$id=$mainConfig->get( 'MainWANCache');if(!isset( $mainConfig->get( 'WANObjectCaches')[$id])) { throw new UnexpectedValueException("WAN cache type \"$id\" is not present in \$wgWANObjectCaches.");} $params=$mainConfig->get( 'WANObjectCaches')[$id];$objectCacheId=$params['cacheId'];if(!isset( $mainConfig->get( 'ObjectCaches')[$objectCacheId])) { throw new UnexpectedValueException("Cache type \"$objectCacheId\" is not present in \$wgObjectCaches.");} $params['store']=$mainConfig->get( 'ObjectCaches')[$objectCacheId];return \ObjectCache::newWANCacheFromParams( $params);}, 'MediaHandlerFactory'=> function(MediaWikiServices $services) :MediaHandlerFactory { return new MediaHandlerFactory($services->getMainConfig() ->get( 'MediaHandlers'));}, 'MimeAnalyzer'=> function(MediaWikiServices $services) :MimeAnalyzer { $logger=LoggerFactory::getInstance( 'Mime');$mainConfig=$services->getMainConfig();$params=['typeFile'=> $mainConfig->get( 'MimeTypeFile'), 'infoFile'=> $mainConfig->get( 'MimeInfoFile'), 'xmlTypes'=> $mainConfig->get( 'XMLMimeTypes'), 'guessCallback'=> function( $mimeAnalyzer, &$head, &$tail, $file, &$mime) use( $logger) { $deja=new DjVuImage( $file);if( $deja->isValid()) { $logger->info("Detected $file as image/vnd.djvu\n");$mime='image/vnd.djvu';return;} Hooks::run('MimeMagicGuessFromContent', [ $mimeAnalyzer, &$head, &$tail, $file, &$mime]);}, 'extCallback'=> function( $mimeAnalyzer, $ext, &$mime) { Hooks::run( 'MimeMagicImproveFromExtension', [ $mimeAnalyzer, $ext, &$mime]);}, 'initCallback'=> function( $mimeAnalyzer) { Hooks::run( 'MimeMagicInit', [ $mimeAnalyzer]);}, 'logger'=> $logger];if( $params['infoFile']==='includes/mime.info') { $params['infoFile']=__DIR__ . "/libs/mime/mime.info";} if( $params['typeFile']==='includes/mime.types') { $params['typeFile']=__DIR__ . "/libs/mime/mime.types";} $detectorCmd=$mainConfig->get( 'MimeDetectorCommand');if( $detectorCmd) { $factory=$services->getShellCommandFactory();$params['detectCallback']=function( $file) use( $detectorCmd, $factory) { $result=$factory->create() ->unsafeParams( $detectorCmd) ->params( $file) ->execute();return $result->getStdout();};} return new MimeAnalyzer( $params);}, 'NameTableStoreFactory'=> function(MediaWikiServices $services) :NameTableStoreFactory { return new NameTableStoreFactory($services->getDBLoadBalancerFactory(), $services->getMainWANObjectCache(), LoggerFactory::getInstance( 'NameTableSqlStore'));}, 'OldRevisionImporter'=> function(MediaWikiServices $services) :OldRevisionImporter { return new ImportableOldRevisionImporter(true, LoggerFactory::getInstance( 'OldRevisionImporter'), $services->getDBLoadBalancer());}, 'Parser'=> function(MediaWikiServices $services) :Parser { return $services->getParserFactory() ->create();}, 'ParserCache'=> function(MediaWikiServices $services) :ParserCache { $config=$services->getMainConfig();$cache=ObjectCache::getInstance( $config->get( 'ParserCacheType'));wfDebugLog( 'caches', 'parser:' . get_class( $cache));return new ParserCache($cache, $config->get( 'CacheEpoch'));}, 'ParserFactory'=> function(MediaWikiServices $services) :ParserFactory { return new ParserFactory($services->getMainConfig() ->get( 'ParserConf'), $services->getMagicWordFactory(), $services->getContentLanguage(), wfUrlProtocols(), $services->getSpecialPageFactory());}, 'PasswordFactory'=> function(MediaWikiServices $services) :PasswordFactory { $config=$services->getMainConfig();return new PasswordFactory($config->get( 'PasswordConfig'), $config->get( 'PasswordDefault'));}, 'PerDbNameStatsdDataFactory'=> function(MediaWikiServices $services) :StatsdDataFactoryInterface { $config=$services->getMainConfig();$wiki=$config->get( 'DBname');return new PrefixingStatsdDataFactoryProxy($services->getStatsdDataFactory(), $wiki);}, 'PreferencesFactory'=> function(MediaWikiServices $services) :PreferencesFactory { $factory=new DefaultPreferencesFactory($services->getMainConfig(), $services->getContentLanguage(), AuthManager::singleton(), $services->getLinkRendererFactory() ->create());$factory->setLogger(LoggerFactory::getInstance( 'preferences'));return $factory;}, 'ProxyLookup'=> function(MediaWikiServices $services) :ProxyLookup { $mainConfig=$services->getMainConfig();return new ProxyLookup($mainConfig->get( 'SquidServers'), $mainConfig->get( 'SquidServersNoPurge'));}, 'ReadOnlyMode'=> function(MediaWikiServices $services) :ReadOnlyMode { return new ReadOnlyMode($services->getConfiguredReadOnlyMode(), $services->getDBLoadBalancer());}, 'RevisionFactory'=> function(MediaWikiServices $services) :RevisionFactory { return $services->getRevisionStore();}, 'RevisionLookup'=> function(MediaWikiServices $services) :RevisionLookup { return $services->getRevisionStore();}, 'RevisionRenderer'=> function(MediaWikiServices $services) :RevisionRenderer { $renderer=new RevisionRenderer( $services->getDBLoadBalancer());$renderer->setLogger(LoggerFactory::getInstance( 'SaveParse'));return $renderer;}, 'RevisionStore'=> function(MediaWikiServices $services) :RevisionStore { return $services->getRevisionStoreFactory() ->getRevisionStore();}, 'RevisionStoreFactory'=> function(MediaWikiServices $services) :RevisionStoreFactory { $config=$services->getMainConfig();$store=new RevisionStoreFactory($services->getDBLoadBalancerFactory(), $services->getBlobStoreFactory(), $services->getNameTableStoreFactory(), $services->getMainWANObjectCache(), $services->getCommentStore(), $services->getActorMigration(), $config->get( 'MultiContentRevisionSchemaMigrationStage'), LoggerFactory::getProvider(), $config->get( 'ContentHandlerUseDB'));return $store;}, 'SearchEngineConfig'=> function(MediaWikiServices $services) :SearchEngineConfig { return new SearchEngineConfig( $services->getMainConfig(), $services->getContentLanguage());}, 'SearchEngineFactory'=> function(MediaWikiServices $services) :SearchEngineFactory { return new SearchEngineFactory( $services->getSearchEngineConfig());}, 'ShellCommandFactory'=> function(MediaWikiServices $services) :CommandFactory { $config=$services->getMainConfig();$limits=['time'=> $config->get( 'MaxShellTime'), 'walltime'=> $config->get( 'MaxShellWallClockTime'), 'memory'=> $config->get( 'MaxShellMemory'), 'filesize'=> $config->get( 'MaxShellFileSize'),];$cgroup=$config->get( 'ShellCgroup');$restrictionMethod=$config->get( 'ShellRestrictionMethod');$factory=new CommandFactory( $limits, $cgroup, $restrictionMethod);$factory->setLogger(LoggerFactory::getInstance( 'exec'));$factory->logStderr();return $factory;}, 'SiteLookup'=> function(MediaWikiServices $services) :SiteLookup { $cacheFile=$services->getMainConfig() ->get( 'SitesCacheFile');if( $cacheFile !==false) { return new FileBasedSiteLookup( $cacheFile);} else { return $services->getSiteStore();} }, 'SiteStore'=> function(MediaWikiServices $services) :SiteStore { $rawSiteStore=new DBSiteStore( $services->getDBLoadBalancer());$cache=wfGetCache(wfIsHHVM() ? CACHE_ACCEL :CACHE_ANYTHING);return new CachingSiteStore( $rawSiteStore, $cache);}, 'SkinFactory'=> function(MediaWikiServices $services) :SkinFactory { $factory=new SkinFactory();$names=$services->getMainConfig() ->get( 'ValidSkinNames');foreach( $names as $name=> $skin) { $factory->register( $name, $skin, function() use( $name, $skin) { $class="Skin$skin";return new $class( $name);});} $factory->register( 'fallback', 'Fallback', function() { return new SkinFallback;});$factory->register( 'apioutput', 'ApiOutput', function() { return new SkinApi;});return $factory;}, 'SpecialPageFactory'=> function(MediaWikiServices $services) :SpecialPageFactory { return new SpecialPageFactory($services->getMainConfig(), $services->getContentLanguage());}, 'StatsdDataFactory'=> function(MediaWikiServices $services) :IBufferingStatsdDataFactory { return new BufferingStatsdDataFactory(rtrim( $services->getMainConfig() ->get( 'StatsdMetricPrefix'), '.'));}, 'TitleFormatter'=> function(MediaWikiServices $services) :TitleFormatter { return $services->getService( '_MediaWikiTitleCodec');}, 'TitleParser'=> function(MediaWikiServices $services) :TitleParser { return $services->getService( '_MediaWikiTitleCodec');}, 'UploadRevisionImporter'=> function(MediaWikiServices $services) :UploadRevisionImporter { return new ImportableUploadRevisionImporter($services->getMainConfig() ->get( 'EnableUploads'), LoggerFactory::getInstance( 'UploadRevisionImporter'));}, 'VirtualRESTServiceClient'=> function(MediaWikiServices $services) :VirtualRESTServiceClient { $config=$services->getMainConfig() ->get( 'VirtualRestConfig');$vrsClient=new VirtualRESTServiceClient(new MultiHttpClient([]));foreach( $config['paths'] as $prefix=> $serviceConfig) { $class=$serviceConfig['class'];$constructArg=$serviceConfig['options'] ??[];$constructArg+=$config['global'];$vrsClient->mount( $prefix, [ 'class'=> $class, 'config'=> $constructArg]);} return $vrsClient;}, 'WatchedItemQueryService'=> function(MediaWikiServices $services) :WatchedItemQueryService { return new WatchedItemQueryService($services->getDBLoadBalancer(), $services->getCommentStore(), $services->getActorMigration());}, 'WatchedItemStore'=> function(MediaWikiServices $services) :WatchedItemStore { $store=new WatchedItemStore($services->getDBLoadBalancerFactory(), new HashBagOStuff([ 'maxKeys'=> 100]), $services->getReadOnlyMode(), $services->getMainConfig() ->get( 'UpdateRowsPerQuery'));$store->setStatsdDataFactory( $services->getStatsdDataFactory());if( $services->getMainConfig() ->get( 'ReadOnlyWatchedItemStore')) { $store=new NoWriteWatchedItemStore( $store);} return $store;}, 'WikiRevisionOldRevisionImporterNoUpdates'=> function(MediaWikiServices $services) :ImportableOldRevisionImporter { return new ImportableOldRevisionImporter(false, LoggerFactory::getInstance( 'OldRevisionImporter'), $services->getDBLoadBalancer());}, '_MediaWikiTitleCodec'=> function(MediaWikiServices $services) :MediaWikiTitleCodec { return new MediaWikiTitleCodec($services->getContentLanguage(), $services->getGenderCache(), $services->getMainConfig() ->get( 'LocalInterwikis'), $services->getInterwikiLookup());}, '_SqlBlobStore'=> function(MediaWikiServices $services) :SqlBlobStore { return $services->getBlobStoreFactory() ->newSqlBlobStore();},]
This class handles the logic for the actor table migration.
Class representing a cache/ephemeral data store.
get( $key, $flags=0, $oldFlags=null)
Get an item with the given key.
A factory for application metric data.
Factory class to create Config objects.
Support for detecting/validating DjVu image files and getting some basic file metadata (resolution et...
A BagOStuff object with no objects in it.
Factory class for spawning EventRelayer objects using configuration.
Provides a file-based cache of a SiteStore.
Caches user genders when needed to use correct namespace aliases.
Simple store for keeping values in an associative array for the current process.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Various HTTP related functions.
Internationalisation code.
Cache for article titles (prefixed DB keys) and ids linked from one source.
static applyDefaultConfig(array $lbConf, Config $mainConfig, ConfiguredReadOnlyMode $readOnlyMode)
static getLBFactoryClass(array $config)
Returns the LBFactory class to use and the load balancer configuration.
static setSchemaAliases(LBFactory $lbFactory, Config $config)
A factory that stores information about MagicWords, and creates them on demand with caching.
Factory for handling the special page list and generating SpecialPage objects.
Class to handle multiple HTTP requests.
Functions to get cache objects.
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static getLocalClusterInstance()
Get the main cluster-local cache object.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Factory class for creating and checking Password objects.
Proxy to prefix metric keys sent to a StatsdDataFactoryInterface.
A service class for fetching the wiki's current read-only mode.
Configuration handling class for SearchEngine.
Factory class for SearchEngine.
SkinTemplate class for API output.
Factory class to create Skin objects.
register( $name, $displayName, $callback)
Register a new Skin factory function.
SkinTemplate class for the fallback skin.
Virtual HTTP service client loosely styled after a Virtual File System.
Multi-datacenter aware caching interface.
get( $key, &$curTTL=null, array $checkKeys=[], &$asOf=null)
Fetch the value of a key from cache.
Storage layer class for WatchedItems.
setStatsdDataFactory(StatsdDataFactoryInterface $stats)
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED since 1.16! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
processing should stop and the error should be shown to the user * false
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Interface for configuration instances.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
A title parser service for MediaWiki.
if( $ext=='php'|| $ext=='php5') $mime
if(!is_readable( $file)) $ext