MediaWiki REL1_32
ServiceWiring.php
Go to the documentation of this file.
1<?php
40use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
62
63return [
64 'ActorMigration' => function ( MediaWikiServices $services ) : ActorMigration {
66 $services->getMainConfig()->get( 'ActorTableSchemaMigrationStage' )
67 );
68 },
69
70 'BlobStore' => function ( MediaWikiServices $services ) : BlobStore {
71 return $services->getService( '_SqlBlobStore' );
72 },
73
74 'BlobStoreFactory' => function ( MediaWikiServices $services ) : BlobStoreFactory {
76 $services->getDBLoadBalancerFactory(),
77 $services->getMainWANObjectCache(),
78 $services->getMainConfig(),
79 $services->getContentLanguage()
80 );
81 },
82
83 'CommentStore' => function ( MediaWikiServices $services ) : CommentStore {
85 $services->getContentLanguage(),
86 $services->getMainConfig()->get( 'CommentTableSchemaMigrationStage' )
87 );
88 },
89
90 'ConfigFactory' => function ( MediaWikiServices $services ) : ConfigFactory {
91 // Use the bootstrap config to initialize the ConfigFactory.
92 $registry = $services->getBootstrapConfig()->get( 'ConfigRegistry' );
93 $factory = new ConfigFactory();
94
95 foreach ( $registry as $name => $callback ) {
96 $factory->register( $name, $callback );
97 }
98 return $factory;
99 },
100
101 'ConfigRepository' => function ( MediaWikiServices $services ) : ConfigRepository {
102 return new ConfigRepository( $services->getConfigFactory() );
103 },
104
105 'ConfiguredReadOnlyMode' => function ( MediaWikiServices $services ) : ConfiguredReadOnlyMode {
106 return new ConfiguredReadOnlyMode( $services->getMainConfig() );
107 },
108
109 'ContentLanguage' => function ( MediaWikiServices $services ) : Language {
110 return Language::factory( $services->getMainConfig()->get( 'LanguageCode' ) );
111 },
112
113 'CryptHKDF' => function ( MediaWikiServices $services ) : CryptHKDF {
114 $config = $services->getMainConfig();
115
116 $secret = $config->get( 'HKDFSecret' ) ?: $config->get( 'SecretKey' );
117 if ( !$secret ) {
118 throw new RuntimeException( "Cannot use MWCryptHKDF without a secret." );
119 }
120
121 // In HKDF, the context can be known to the attacker, but this will
122 // keep simultaneous runs from producing the same output.
123 $context = [ microtime(), getmypid(), gethostname() ];
124
125 // Setup salt cache. Use APC, or fallback to the main cache if it isn't setup
126 $cache = $services->getLocalServerObjectCache();
127 if ( $cache instanceof EmptyBagOStuff ) {
129 }
130
131 return new CryptHKDF( $secret, $config->get( 'HKDFAlgorithm' ), $cache, $context );
132 },
133
134 'CryptRand' => function () : CryptRand {
135 return new CryptRand();
136 },
137
138 'DBLoadBalancer' => function ( MediaWikiServices $services ) : Wikimedia\Rdbms\LoadBalancer {
139 // just return the default LB from the DBLoadBalancerFactory service
140 return $services->getDBLoadBalancerFactory()->getMainLB();
141 },
142
143 'DBLoadBalancerFactory' =>
144 function ( MediaWikiServices $services ) : Wikimedia\Rdbms\LBFactory {
145 $mainConfig = $services->getMainConfig();
146
148 $mainConfig->get( 'LBFactoryConf' ),
149 $mainConfig,
150 $services->getConfiguredReadOnlyMode()
151 );
152 $class = MWLBFactory::getLBFactoryClass( $lbConf );
153
154 $instance = new $class( $lbConf );
155 MWLBFactory::setSchemaAliases( $instance, $mainConfig );
156
157 return $instance;
158 },
159
160 'EventRelayerGroup' => function ( MediaWikiServices $services ) : EventRelayerGroup {
161 return new EventRelayerGroup( $services->getMainConfig()->get( 'EventRelayerConfig' ) );
162 },
163
164 'ExternalStoreFactory' => function ( MediaWikiServices $services ) : ExternalStoreFactory {
165 $config = $services->getMainConfig();
166
167 return new ExternalStoreFactory(
168 $config->get( 'ExternalStores' )
169 );
170 },
171
172 'GenderCache' => function ( MediaWikiServices $services ) : GenderCache {
173 return new GenderCache();
174 },
175
176 'HttpRequestFactory' =>
177 function ( MediaWikiServices $services ) : \MediaWiki\Http\HttpRequestFactory {
178 return new \MediaWiki\Http\HttpRequestFactory();
179 },
180
181 'InterwikiLookup' => function ( MediaWikiServices $services ) : InterwikiLookup {
182 $config = $services->getMainConfig();
183 return new ClassicInterwikiLookup(
184 $services->getContentLanguage(),
185 $services->getMainWANObjectCache(),
186 $config->get( 'InterwikiExpiry' ),
187 $config->get( 'InterwikiCache' ),
188 $config->get( 'InterwikiScopes' ),
189 $config->get( 'InterwikiFallbackSite' )
190 );
191 },
192
193 'LinkCache' => function ( MediaWikiServices $services ) : LinkCache {
194 return new LinkCache(
195 $services->getTitleFormatter(),
196 $services->getMainWANObjectCache()
197 );
198 },
199
200 'LinkRenderer' => function ( MediaWikiServices $services ) : LinkRenderer {
201 global $wgUser;
202
203 if ( defined( 'MW_NO_SESSION' ) ) {
204 return $services->getLinkRendererFactory()->create();
205 } else {
206 return $services->getLinkRendererFactory()->createForUser( $wgUser );
207 }
208 },
209
210 'LinkRendererFactory' => function ( MediaWikiServices $services ) : LinkRendererFactory {
212 $services->getTitleFormatter(),
213 $services->getLinkCache()
214 );
215 },
216
217 'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff {
218 $cacheId = \ObjectCache::detectLocalServerCache();
219 return \ObjectCache::newFromId( $cacheId );
220 },
221
222 'MagicWordFactory' => function ( MediaWikiServices $services ) : MagicWordFactory {
223 return new MagicWordFactory( $services->getContentLanguage() );
224 },
225
226 'MainConfig' => function ( MediaWikiServices $services ) : Config {
227 // Use the 'main' config from the ConfigFactory service.
228 return $services->getConfigFactory()->makeConfig( 'main' );
229 },
230
231 'MainObjectStash' => function ( MediaWikiServices $services ) : BagOStuff {
232 $mainConfig = $services->getMainConfig();
233
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." );
238 }
239
240 return \ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] );
241 },
242
243 'MainWANObjectCache' => function ( MediaWikiServices $services ) : WANObjectCache {
244 $mainConfig = $services->getMainConfig();
245
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." );
250 }
251
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." );
257 }
258 $params['store'] = $mainConfig->get( 'ObjectCaches' )[$objectCacheId];
259
260 return \ObjectCache::newWANCacheFromParams( $params );
261 },
262
263 'MediaHandlerFactory' => function ( MediaWikiServices $services ) : MediaHandlerFactory {
265 $services->getMainConfig()->get( 'MediaHandlers' )
266 );
267 },
268
269 'MimeAnalyzer' => function ( MediaWikiServices $services ) : MimeAnalyzer {
270 $logger = LoggerFactory::getInstance( 'Mime' );
271 $mainConfig = $services->getMainConfig();
272 $params = [
273 'typeFile' => $mainConfig->get( 'MimeTypeFile' ),
274 'infoFile' => $mainConfig->get( 'MimeInfoFile' ),
275 'xmlTypes' => $mainConfig->get( 'XMLMimeTypes' ),
276 'guessCallback' =>
277 function ( $mimeAnalyzer, &$head, &$tail, $file, &$mime ) use ( $logger ) {
278 // Also test DjVu
279 $deja = new DjVuImage( $file );
280 if ( $deja->isValid() ) {
281 $logger->info( "Detected $file as image/vnd.djvu\n" );
282 $mime = 'image/vnd.djvu';
283
284 return;
285 }
286 // Some strings by reference for performance - assuming well-behaved hooks
288 'MimeMagicGuessFromContent',
289 [ $mimeAnalyzer, &$head, &$tail, $file, &$mime ]
290 );
291 },
292 'extCallback' => function ( $mimeAnalyzer, $ext, &$mime ) {
293 // Media handling extensions can improve the MIME detected
294 Hooks::run( 'MimeMagicImproveFromExtension', [ $mimeAnalyzer, $ext, &$mime ] );
295 },
296 'initCallback' => function ( $mimeAnalyzer ) {
297 // Allow media handling extensions adding MIME-types and MIME-info
298 Hooks::run( 'MimeMagicInit', [ $mimeAnalyzer ] );
299 },
300 'logger' => $logger
301 ];
302
303 if ( $params['infoFile'] === 'includes/mime.info' ) {
304 $params['infoFile'] = __DIR__ . "/libs/mime/mime.info";
305 }
306
307 if ( $params['typeFile'] === 'includes/mime.types' ) {
308 $params['typeFile'] = __DIR__ . "/libs/mime/mime.types";
309 }
310
311 $detectorCmd = $mainConfig->get( 'MimeDetectorCommand' );
312 if ( $detectorCmd ) {
313 $factory = $services->getShellCommandFactory();
314 $params['detectCallback'] = function ( $file ) use ( $detectorCmd, $factory ) {
315 $result = $factory->create()
316 // $wgMimeDetectorCommand can contain commands with parameters
317 ->unsafeParams( $detectorCmd )
318 ->params( $file )
319 ->execute();
320 return $result->getStdout();
321 };
322 }
323
324 return new MimeAnalyzer( $params );
325 },
326
327 'NameTableStoreFactory' => function ( MediaWikiServices $services ) : NameTableStoreFactory {
329 $services->getDBLoadBalancerFactory(),
330 $services->getMainWANObjectCache(),
331 LoggerFactory::getInstance( 'NameTableSqlStore' )
332 );
333 },
334
335 'OldRevisionImporter' => function ( MediaWikiServices $services ) : OldRevisionImporter {
337 true,
338 LoggerFactory::getInstance( 'OldRevisionImporter' ),
339 $services->getDBLoadBalancer()
340 );
341 },
342
343 'Parser' => function ( MediaWikiServices $services ) : Parser {
344 return $services->getParserFactory()->create();
345 },
346
347 'ParserCache' => function ( MediaWikiServices $services ) : ParserCache {
348 $config = $services->getMainConfig();
349 $cache = ObjectCache::getInstance( $config->get( 'ParserCacheType' ) );
350 wfDebugLog( 'caches', 'parser: ' . get_class( $cache ) );
351
352 return new ParserCache(
353 $cache,
354 $config->get( 'CacheEpoch' )
355 );
356 },
357
358 'ParserFactory' => function ( MediaWikiServices $services ) : ParserFactory {
360 $services->getMainConfig()->get( 'ParserConf' ),
361 $services->getMagicWordFactory(),
362 $services->getContentLanguage(),
364 $services->getSpecialPageFactory()
365 );
366 },
367
368 'PasswordFactory' => function ( MediaWikiServices $services ) : PasswordFactory {
369 $config = $services->getMainConfig();
370 return new PasswordFactory(
371 $config->get( 'PasswordConfig' ),
372 $config->get( 'PasswordDefault' )
373 );
374 },
375
376 'PerDbNameStatsdDataFactory' =>
377 function ( MediaWikiServices $services ) : StatsdDataFactoryInterface {
378 $config = $services->getMainConfig();
379 $wiki = $config->get( 'DBname' );
381 $services->getStatsdDataFactory(),
382 $wiki
383 );
384 },
385
386 'PreferencesFactory' => function ( MediaWikiServices $services ) : PreferencesFactory {
387 $factory = new DefaultPreferencesFactory(
388 $services->getMainConfig(),
389 $services->getContentLanguage(),
390 AuthManager::singleton(),
391 $services->getLinkRendererFactory()->create()
392 );
393 $factory->setLogger( LoggerFactory::getInstance( 'preferences' ) );
394
395 return $factory;
396 },
397
398 'ProxyLookup' => function ( MediaWikiServices $services ) : ProxyLookup {
399 $mainConfig = $services->getMainConfig();
400 return new ProxyLookup(
401 $mainConfig->get( 'SquidServers' ),
402 $mainConfig->get( 'SquidServersNoPurge' )
403 );
404 },
405
406 'ReadOnlyMode' => function ( MediaWikiServices $services ) : ReadOnlyMode {
408 $services->getConfiguredReadOnlyMode(),
409 $services->getDBLoadBalancer()
410 );
411 },
412
413 'RevisionFactory' => function ( MediaWikiServices $services ) : RevisionFactory {
414 return $services->getRevisionStore();
415 },
416
417 'RevisionLookup' => function ( MediaWikiServices $services ) : RevisionLookup {
418 return $services->getRevisionStore();
419 },
420
421 'RevisionRenderer' => function ( MediaWikiServices $services ) : RevisionRenderer {
422 $renderer = new RevisionRenderer( $services->getDBLoadBalancer() );
423 $renderer->setLogger( LoggerFactory::getInstance( 'SaveParse' ) );
424
425 return $renderer;
426 },
427
428 'RevisionStore' => function ( MediaWikiServices $services ) : RevisionStore {
429 return $services->getRevisionStoreFactory()->getRevisionStore();
430 },
431
432 'RevisionStoreFactory' => function ( MediaWikiServices $services ) : RevisionStoreFactory {
433 $config = $services->getMainConfig();
434 $store = new RevisionStoreFactory(
435 $services->getDBLoadBalancerFactory(),
436 $services->getBlobStoreFactory(),
437 $services->getNameTableStoreFactory(),
438 $services->getMainWANObjectCache(),
439 $services->getCommentStore(),
440 $services->getActorMigration(),
441 $config->get( 'MultiContentRevisionSchemaMigrationStage' ),
442 LoggerFactory::getProvider(),
443 $config->get( 'ContentHandlerUseDB' )
444 );
445
446 return $store;
447 },
448
449 'SearchEngineConfig' => function ( MediaWikiServices $services ) : SearchEngineConfig {
450 return new SearchEngineConfig( $services->getMainConfig(),
451 $services->getContentLanguage() );
452 },
453
454 'SearchEngineFactory' => function ( MediaWikiServices $services ) : SearchEngineFactory {
455 return new SearchEngineFactory( $services->getSearchEngineConfig() );
456 },
457
458 'ShellCommandFactory' => function ( MediaWikiServices $services ) : CommandFactory {
459 $config = $services->getMainConfig();
460
461 $limits = [
462 'time' => $config->get( 'MaxShellTime' ),
463 'walltime' => $config->get( 'MaxShellWallClockTime' ),
464 'memory' => $config->get( 'MaxShellMemory' ),
465 'filesize' => $config->get( 'MaxShellFileSize' ),
466 ];
467 $cgroup = $config->get( 'ShellCgroup' );
468 $restrictionMethod = $config->get( 'ShellRestrictionMethod' );
469
470 $factory = new CommandFactory( $limits, $cgroup, $restrictionMethod );
471 $factory->setLogger( LoggerFactory::getInstance( 'exec' ) );
472 $factory->logStderr();
473
474 return $factory;
475 },
476
477 'SiteLookup' => function ( MediaWikiServices $services ) : SiteLookup {
478 $cacheFile = $services->getMainConfig()->get( 'SitesCacheFile' );
479
480 if ( $cacheFile !== false ) {
481 return new FileBasedSiteLookup( $cacheFile );
482 } else {
483 // Use the default SiteStore as the SiteLookup implementation for now
484 return $services->getSiteStore();
485 }
486 },
487
488 'SiteStore' => function ( MediaWikiServices $services ) : SiteStore {
489 $rawSiteStore = new DBSiteStore( $services->getDBLoadBalancer() );
490
491 // TODO: replace wfGetCache with a CacheFactory service.
492 // TODO: replace wfIsHHVM with a capabilities service.
494
495 return new CachingSiteStore( $rawSiteStore, $cache );
496 },
497
498 'SkinFactory' => function ( MediaWikiServices $services ) : SkinFactory {
499 $factory = new SkinFactory();
500
501 $names = $services->getMainConfig()->get( 'ValidSkinNames' );
502
503 foreach ( $names as $name => $skin ) {
504 $factory->register( $name, $skin, function () use ( $name, $skin ) {
505 $class = "Skin$skin";
506 return new $class( $name );
507 } );
508 }
509 // Register a hidden "fallback" skin
510 $factory->register( 'fallback', 'Fallback', function () {
511 return new SkinFallback;
512 } );
513 // Register a hidden skin for api output
514 $factory->register( 'apioutput', 'ApiOutput', function () {
515 return new SkinApi;
516 } );
517
518 return $factory;
519 },
520
521 'SpecialPageFactory' => function ( MediaWikiServices $services ) : SpecialPageFactory {
523 $services->getMainConfig(),
524 $services->getContentLanguage()
525 );
526 },
527
528 'StatsdDataFactory' => function ( MediaWikiServices $services ) : IBufferingStatsdDataFactory {
530 rtrim( $services->getMainConfig()->get( 'StatsdMetricPrefix' ), '.' )
531 );
532 },
533
534 'TitleFormatter' => function ( MediaWikiServices $services ) : TitleFormatter {
535 return $services->getService( '_MediaWikiTitleCodec' );
536 },
537
538 'TitleParser' => function ( MediaWikiServices $services ) : TitleParser {
539 return $services->getService( '_MediaWikiTitleCodec' );
540 },
541
542 'UploadRevisionImporter' => function ( MediaWikiServices $services ) : UploadRevisionImporter {
544 $services->getMainConfig()->get( 'EnableUploads' ),
545 LoggerFactory::getInstance( 'UploadRevisionImporter' )
546 );
547 },
548
549 'VirtualRESTServiceClient' =>
551 $config = $services->getMainConfig()->get( 'VirtualRestConfig' );
552
553 $vrsClient = new VirtualRESTServiceClient( new MultiHttpClient( [] ) );
554 foreach ( $config['paths'] as $prefix => $serviceConfig ) {
555 $class = $serviceConfig['class'];
556 // Merge in the global defaults
557 $constructArg = $serviceConfig['options'] ?? [];
558 $constructArg += $config['global'];
559 // Make the VRS service available at the mount point
560 $vrsClient->mount( $prefix, [ 'class' => $class, 'config' => $constructArg ] );
561 }
562
563 return $vrsClient;
564 },
565
566 'WatchedItemQueryService' =>
569 $services->getDBLoadBalancer(),
570 $services->getCommentStore(),
571 $services->getActorMigration()
572 );
573 },
574
575 'WatchedItemStore' => function ( MediaWikiServices $services ) : WatchedItemStore {
576 $store = new WatchedItemStore(
577 $services->getDBLoadBalancerFactory(),
578 new HashBagOStuff( [ 'maxKeys' => 100 ] ),
579 $services->getReadOnlyMode(),
580 $services->getMainConfig()->get( 'UpdateRowsPerQuery' )
581 );
582 $store->setStatsdDataFactory( $services->getStatsdDataFactory() );
583
584 if ( $services->getMainConfig()->get( 'ReadOnlyWatchedItemStore' ) ) {
585 $store = new NoWriteWatchedItemStore( $store );
586 }
587
588 return $store;
589 },
590
591 'WikiRevisionOldRevisionImporterNoUpdates' =>
594 false,
595 LoggerFactory::getInstance( 'OldRevisionImporter' ),
596 $services->getDBLoadBalancer()
597 );
598 },
599
600 '_MediaWikiTitleCodec' => function ( MediaWikiServices $services ) : MediaWikiTitleCodec {
602 $services->getContentLanguage(),
603 $services->getGenderCache(),
604 $services->getMainConfig()->get( 'LocalInterwikis' ),
605 $services->getInterwikiLookup()
606 );
607 },
608
609 '_SqlBlobStore' => function ( MediaWikiServices $services ) : SqlBlobStore {
610 return $services->getBlobStoreFactory()->newSqlBlobStore();
611 },
612
614 // NOTE: When adding a service here, don't forget to add a getter function
615 // in the MediaWikiServices class. The convenience getter should just call
616 // $this->getService( 'FooBarService' ).
618
619];
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.
Definition BagOStuff.php:58
get( $key, $flags=0, $oldFlags=null)
Get an item with the given key.
A factory for application metric data.
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Factory class to create Config objects.
A read-only mode service which does not depend on LoadBalancer.
Support for detecting/validating DjVu image files and getting some basic file metadata (resolution et...
Definition DjVuImage.php:36
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.
Definition Hooks.php:200
Various HTTP related functions.
Definition Http.php:27
Internationalisation code.
Definition Language.php:35
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition LinkCache.php:34
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.
Class to construct MediaHandler objects.
A codec for MediaWiki page titles.
This serves as the entry point to the authentication system.
Object which holds currently registered configuration options.
InterwikiLookup implementing the "classic" interwiki storage (hardcoded up to MW 1....
Factory to create LinkRender objects.
Class that generates HTML links for pages.
PSR-3 logger instance factory.
MediaWikiServices is the service locator for the application scope of MediaWiki.
This is the default implementation of PreferencesFactory.
The RevisionRenderer service provides access to rendered output for revisions.
setLogger(LoggerInterface $saveParseLogger)
Factory service for RevisionStore instances.
Service for looking up page revisions.
Factory facilitating dependency injection for Command.
Factory for handling the special page list and generating SpecialPage objects.
Service for instantiating BlobStores.
Service for storing and loading Content 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...
Definition Parser.php:68
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.
Definition SkinApi.php:31
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)
const CACHE_ANYTHING
Definition Defines.php:101
const CACHE_ACCEL
Definition Defines.php:105
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
Definition hooks.txt:2042
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
Definition hooks.txt:2885
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
Definition hooks.txt:2055
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
Definition hooks.txt:2335
processing should stop and the error should be shown to the user * false
Definition hooks.txt:187
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
Definition injection.txt:37
Interface for configuration instances.
Definition Config.php:28
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Service interface for looking up Interwiki records.
A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a given ...
Service for constructing revision objects.
Service for looking up page revisions.
Service for loading and storing data blobs.
Definition BlobStore.php:33
A title formatter service for MediaWiki.
A title parser service for MediaWiki.
$cache
Definition mcc.php:33
A helper class for throttling authentication attempts.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
if( $ext=='php'|| $ext=='php5') $mime
Definition router.php:59
if(!is_readable( $file)) $ext
Definition router.php:55
$params