MediaWiki  1.33.0
MediaWikiServices.php
Go to the documentation of this file.
1 <?php
2 namespace MediaWiki;
3 
6 use Config;
13 use Hooks;
15 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
44 use Parser;
49 use ResourceLoader;
66 
103 class MediaWikiServices extends ServiceContainer {
104 
108  private static $instance = null;
109 
124  public static function getInstance() {
125  if ( self::$instance === null ) {
126  // NOTE: constructing GlobalVarConfig here is not particularly pretty,
127  // but some information from the global scope has to be injected here,
128  // even if it's just a file name or database credentials to load
129  // configuration from.
130  $bootstrapConfig = new GlobalVarConfig();
131  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
132  }
133 
134  return self::$instance;
135  }
136 
150  public static function forceGlobalInstance( MediaWikiServices $services ) {
151  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
152  throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
153  }
154 
155  $old = self::getInstance();
156  self::$instance = $services;
157 
158  return $old;
159  }
160 
200  public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
201  if ( self::$instance === null ) {
202  // no global instance yet, nothing to reset
203  return;
204  }
205 
206  self::failIfResetNotAllowed( __METHOD__ );
207 
208  if ( $bootstrapConfig === null ) {
209  $bootstrapConfig = self::$instance->getBootstrapConfig();
210  }
211 
212  $oldInstance = self::$instance;
213 
214  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
215  self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
216 
217  if ( $quick === 'quick' ) {
218  self::$instance->salvage( $oldInstance );
219  } else {
220  $oldInstance->destroy();
221  }
222  }
223 
231  private function salvage( self $other ) {
232  foreach ( $this->getServiceNames() as $name ) {
233  // The service could be new in the new instance and not registered in the
234  // other instance (e.g. an extension that was loaded after the instantiation of
235  // the other instance. Skip this service in this case. See T143974
236  try {
237  $oldService = $other->peekService( $name );
238  } catch ( NoSuchServiceException $e ) {
239  continue;
240  }
241 
242  if ( $oldService instanceof SalvageableService ) {
244  $newService = $this->getService( $name );
245  $newService->salvage( $oldService );
246  }
247  }
248 
249  $other->destroy();
250  }
251 
267  private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
268  $instance = new self( $bootstrapConfig );
269 
270  // Load the default wiring from the specified files.
271  if ( $loadWiring === 'load' ) {
272  $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
273  $instance->loadWiringFiles( $wiringFiles );
274  }
275 
276  // Provide a traditional hook point to allow extensions to configure services.
277  Hooks::run( 'MediaWikiServices', [ $instance ] );
278 
279  return $instance;
280  }
281 
297  public static function disableStorageBackend() {
298  // TODO: also disable some Caches, JobQueues, etc
299  $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
300  $services = self::getInstance();
301 
302  foreach ( $destroy as $name ) {
303  $services->disableService( $name );
304  }
305 
307  }
308 
321  public static function resetChildProcessServices() {
322  // NOTE: for now, just reset everything. Since we don't know the interdependencies
323  // between services, we can't do this more selectively at this time.
324  self::resetGlobalInstance();
325 
326  // Child, reseed because there is no bug in PHP:
327  // https://bugs.php.net/bug.php?id=42465
328  mt_srand( getmypid() );
329  }
330 
352  public function resetServiceForTesting( $name, $destroy = true ) {
353  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
354  throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
355  }
356 
357  $this->resetService( $name, $destroy );
358  }
359 
387  public static function failIfResetNotAllowed( $method ) {
388  if ( !defined( 'MW_PHPUNIT_TEST' )
389  && !defined( 'MW_PARSER_TEST' )
390  && !defined( 'MEDIAWIKI_INSTALL' )
391  && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
392  && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
393  ) {
394  throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
395  }
396  }
397 
403  public function __construct( Config $config ) {
404  parent::__construct();
405 
406  // Register the given Config object as the bootstrap config service.
407  $this->defineService( 'BootstrapConfig', function () use ( $config ) {
408  return $config;
409  } );
410  }
411 
412  // CONVENIENCE GETTERS ////////////////////////////////////////////////////
413 
418  public function getActorMigration() {
419  return $this->getService( 'ActorMigration' );
420  }
421 
426  public function getBlobStore() {
427  return $this->getService( '_SqlBlobStore' );
428  }
429 
434  public function getBlobStoreFactory() {
435  return $this->getService( 'BlobStoreFactory' );
436  }
437 
442  public function getBlockRestrictionStore() : BlockRestrictionStore {
443  return $this->getService( 'BlockRestrictionStore' );
444  }
445 
459  public function getBootstrapConfig() {
460  return $this->getService( 'BootstrapConfig' );
461  }
462 
467  public function getChangeTagDefStore() {
468  return $this->getService( 'NameTableStoreFactory' )->getChangeTagDef();
469  }
470 
475  public function getCommentStore() {
476  return $this->getService( 'CommentStore' );
477  }
478 
483  public function getConfigFactory() {
484  return $this->getService( 'ConfigFactory' );
485  }
486 
491  public function getConfigRepository() {
492  return $this->getService( 'ConfigRepository' );
493  }
494 
499  public function getConfiguredReadOnlyMode() {
500  return $this->getService( 'ConfiguredReadOnlyMode' );
501  }
502 
507  public function getContentLanguage() {
508  return $this->getService( 'ContentLanguage' );
509  }
510 
515  public function getContentModelStore() {
516  return $this->getService( 'NameTableStoreFactory' )->getContentModels();
517  }
518 
523  public function getCryptHKDF() {
524  return $this->getService( 'CryptHKDF' );
525  }
526 
532  public function getCryptRand() {
533  wfDeprecated( __METHOD__, '1.32' );
534  return $this->getService( 'CryptRand' );
535  }
536 
541  public function getDBLoadBalancer() {
542  return $this->getService( 'DBLoadBalancer' );
543  }
544 
549  public function getDBLoadBalancerFactory() {
550  return $this->getService( 'DBLoadBalancerFactory' );
551  }
552 
557  public function getEventRelayerGroup() {
558  return $this->getService( 'EventRelayerGroup' );
559  }
560 
565  public function getExternalStoreFactory() {
566  return $this->getService( 'ExternalStoreFactory' );
567  }
568 
573  public function getGenderCache() {
574  return $this->getService( 'GenderCache' );
575  }
576 
581  public function getHttpRequestFactory() {
582  return $this->getService( 'HttpRequestFactory' );
583  }
584 
589  public function getInterwikiLookup() {
590  return $this->getService( 'InterwikiLookup' );
591  }
592 
597  public function getLinkCache() {
598  return $this->getService( 'LinkCache' );
599  }
600 
608  public function getLinkRenderer() {
609  return $this->getService( 'LinkRenderer' );
610  }
611 
616  public function getLinkRendererFactory() {
617  return $this->getService( 'LinkRendererFactory' );
618  }
619 
624  public function getLocalServerObjectCache() {
625  return $this->getService( 'LocalServerObjectCache' );
626  }
627 
632  public function getMagicWordFactory() {
633  return $this->getService( 'MagicWordFactory' );
634  }
635 
643  public function getMainConfig() {
644  return $this->getService( 'MainConfig' );
645  }
646 
651  public function getMainObjectStash() {
652  return $this->getService( 'MainObjectStash' );
653  }
654 
659  public function getMainWANObjectCache() {
660  return $this->getService( 'MainWANObjectCache' );
661  }
662 
667  public function getMediaHandlerFactory() {
668  return $this->getService( 'MediaHandlerFactory' );
669  }
670 
675  public function getMimeAnalyzer() {
676  return $this->getService( 'MimeAnalyzer' );
677  }
678 
683  public function getNameTableStoreFactory() {
684  return $this->getService( 'NameTableStoreFactory' );
685  }
686 
690  public function getOldRevisionImporter() {
691  return $this->getService( 'OldRevisionImporter' );
692  }
693 
698  public function getParser() {
699  return $this->getService( 'Parser' );
700  }
701 
706  public function getParserCache() {
707  return $this->getService( 'ParserCache' );
708  }
709 
714  public function getParserFactory() {
715  return $this->getService( 'ParserFactory' );
716  }
717 
722  public function getPasswordFactory() {
723  return $this->getService( 'PasswordFactory' );
724  }
725 
730  public function getPerDbNameStatsdDataFactory() {
731  return $this->getService( 'PerDbNameStatsdDataFactory' );
732  }
733 
738  public function getPermissionManager() {
739  return $this->getService( 'PermissionManager' );
740  }
741 
746  public function getPreferencesFactory() {
747  return $this->getService( 'PreferencesFactory' );
748  }
749 
754  public function getProxyLookup() {
755  return $this->getService( 'ProxyLookup' );
756  }
757 
762  public function getReadOnlyMode() {
763  return $this->getService( 'ReadOnlyMode' );
764  }
765 
770  public function getResourceLoader() {
771  return $this->getService( 'ResourceLoader' );
772  }
773 
778  public function getRevisionFactory() {
779  return $this->getService( 'RevisionFactory' );
780  }
781 
786  public function getRevisionLookup() {
787  return $this->getService( 'RevisionLookup' );
788  }
789 
794  public function getRevisionRenderer() {
795  return $this->getService( 'RevisionRenderer' );
796  }
797 
802  public function getRevisionStore() {
803  return $this->getService( 'RevisionStore' );
804  }
805 
810  public function getRevisionStoreFactory() {
811  return $this->getService( 'RevisionStoreFactory' );
812  }
813 
818  public function newSearchEngine() {
819  // New engine object every time, since they keep state
820  return $this->getService( 'SearchEngineFactory' )->create();
821  }
822 
827  public function getSearchEngineConfig() {
828  return $this->getService( 'SearchEngineConfig' );
829  }
830 
835  public function getSearchEngineFactory() {
836  return $this->getService( 'SearchEngineFactory' );
837  }
838 
843  public function getShellCommandFactory() {
844  return $this->getService( 'ShellCommandFactory' );
845  }
846 
851  public function getSiteLookup() {
852  return $this->getService( 'SiteLookup' );
853  }
854 
859  public function getSiteStore() {
860  return $this->getService( 'SiteStore' );
861  }
862 
867  public function getSkinFactory() {
868  return $this->getService( 'SkinFactory' );
869  }
870 
875  public function getSlotRoleRegistry() {
876  return $this->getService( 'SlotRoleRegistry' );
877  }
878 
883  public function getSlotRoleStore() {
884  return $this->getService( 'NameTableStoreFactory' )->getSlotRoles();
885  }
886 
892  return $this->getService( 'SpecialPageFactory' );
893  }
894 
899  public function getStatsdDataFactory() {
900  return $this->getService( 'StatsdDataFactory' );
901  }
902 
907  public function getTitleFormatter() {
908  return $this->getService( 'TitleFormatter' );
909  }
910 
915  public function getTitleParser() {
916  return $this->getService( 'TitleParser' );
917  }
918 
923  public function getUploadRevisionImporter() {
924  return $this->getService( 'UploadRevisionImporter' );
925  }
926 
931  public function getVirtualRESTServiceClient() {
932  return $this->getService( 'VirtualRESTServiceClient' );
933  }
934 
939  public function getWatchedItemQueryService() {
940  return $this->getService( 'WatchedItemQueryService' );
941  }
942 
947  public function getWatchedItemStore() {
948  return $this->getService( 'WatchedItemStore' );
949  }
950 
956  return $this->getService( 'OldRevisionImporter' );
957  }
958 
964  return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
965  }
966 
971  public function getWikiRevisionUploadImporter() {
972  return $this->getService( 'UploadRevisionImporter' );
973  }
974 
975 }
EventRelayerGroup
Factory class for spawning EventRelayer objects using configuration.
Definition: EventRelayerGroup.php:26
ObjectCache\clear
static clear()
Clear all the cached instances.
Definition: ObjectCache.php:399
ObjectCache
Functions to get cache objects.
Definition: ObjectCache.php:80
LinkCache
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition: LinkCache.php:34
MediaWiki\MediaWikiServices\getShellCommandFactory
getShellCommandFactory()
Definition: MediaWikiServices.php:843
SpecialPageFactory
Wrapper for backward compatibility for old callers that used static methods.
Definition: SpecialPageFactory_deprecated.php:34
MediaWiki\MediaWikiServices\getInterwikiLookup
getInterwikiLookup()
Definition: MediaWikiServices.php:589
MediaWiki\MediaWikiServices\getResourceLoader
getResourceLoader()
Definition: MediaWikiServices.php:770
MediaWiki\MediaWikiServices\getSearchEngineConfig
getSearchEngineConfig()
Definition: MediaWikiServices.php:827
UploadRevisionImporter
Definition: UploadRevisionImporter.php:6
MagicWordFactory
A factory that stores information about MagicWords, and creates them on demand with caching.
Definition: MagicWordFactory.php:34
MediaWiki\MediaWikiServices\getSiteLookup
getSiteLookup()
Definition: MediaWikiServices.php:851
MediaWiki\MediaWikiServices\getParserFactory
getParserFactory()
Definition: MediaWikiServices.php:714
MediaWiki\MediaWikiServices\getBlockRestrictionStore
getBlockRestrictionStore()
Definition: MediaWikiServices.php:442
MediaWiki\MediaWikiServices\getDBLoadBalancer
getDBLoadBalancer()
Definition: MediaWikiServices.php:541
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:103
MimeAnalyzer
Implements functions related to MIME types such as detection and mapping to file extension.
Definition: MimeAnalyzer.php:30
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:76
MediaWiki\Http\HttpRequestFactory
Factory creating MWHttpRequest objects.
Definition: HttpRequestFactory.php:34
MediaWiki\MediaWikiServices\getContentModelStore
getContentModelStore()
Definition: MediaWikiServices.php:515
MediaWiki\MediaWikiServices\getChangeTagDefStore
getChangeTagDefStore()
Definition: MediaWikiServices.php:467
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
MediaWiki\MediaWikiServices\getRevisionLookup
getRevisionLookup()
Definition: MediaWikiServices.php:786
MediaWiki\MediaWikiServices\getBootstrapConfig
getBootstrapConfig()
Returns the Config object containing the bootstrap configuration.
Definition: MediaWikiServices.php:459
MediaWiki\MediaWikiServices\getCryptRand
getCryptRand()
Definition: MediaWikiServices.php:532
MediaWiki\MediaWikiServices\getCommentStore
getCommentStore()
Definition: MediaWikiServices.php:475
MediaWiki\MediaWikiServices\getSlotRoleStore
getSlotRoleStore()
Definition: MediaWikiServices.php:883
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:31
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
MediaWiki\Linker\LinkRendererFactory
Factory to create LinkRender objects.
Definition: LinkRendererFactory.php:31
SearchEngineFactory
Factory class for SearchEngine.
Definition: SearchEngineFactory.php:9
Revision\RevisionFactory
Service for constructing revision objects.
Definition: RevisionFactory.php:37
MediaWiki\MediaWikiServices\getActorMigration
getActorMigration()
Definition: MediaWikiServices.php:418
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:35
MediaWiki\MediaWikiServices\getPermissionManager
getPermissionManager()
Definition: MediaWikiServices.php:738
MediaWiki\MediaWikiServices\getGenderCache
getGenderCache()
Definition: MediaWikiServices.php:573
MediaWiki\MediaWikiServices\getEventRelayerGroup
getEventRelayerGroup()
Definition: MediaWikiServices.php:557
Wikimedia\Services\NoSuchServiceException
Exception thrown when the requested service is not known.
Definition: NoSuchServiceException.php:33
SiteLookup
Definition: SiteLookup.php:28
Revision\RevisionLookup
Service for looking up page revisions.
Definition: RevisionLookup.php:38
php
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:35
MediaHandlerFactory
Class to construct MediaHandler objects.
Definition: MediaHandlerFactory.php:29
MediaWiki\MediaWikiServices\getOldRevisionImporter
getOldRevisionImporter()
Definition: MediaWikiServices.php:690
MediaWiki\MediaWikiServices\getUploadRevisionImporter
getUploadRevisionImporter()
Definition: MediaWikiServices.php:923
MediaWiki\MediaWikiServices\getProxyLookup
getProxyLookup()
Definition: MediaWikiServices.php:754
MediaWiki\MediaWikiServices\getSkinFactory
getSkinFactory()
Definition: MediaWikiServices.php:867
SiteStore
Definition: SiteStore.php:29
MediaWiki\MediaWikiServices\failIfResetNotAllowed
static failIfResetNotAllowed( $method)
Convenience method that throws an exception unless it is called during a phase in which resetting of ...
Definition: MediaWikiServices.php:387
Config
Interface for configuration instances.
Definition: Config.php:28
MediaWiki\MediaWikiServices\getSpecialPageFactory
getSpecialPageFactory()
Definition: MediaWikiServices.php:891
MediaWiki\MediaWikiServices\getMagicWordFactory
getMagicWordFactory()
Definition: MediaWikiServices.php:632
MediaWiki\MediaWikiServices\getPerDbNameStatsdDataFactory
getPerDbNameStatsdDataFactory()
Definition: MediaWikiServices.php:730
MWException
MediaWiki exception.
Definition: MWException.php:26
MediaWiki\MediaWikiServices\resetServiceForTesting
resetServiceForTesting( $name, $destroy=true)
Resets the given service for testing purposes.
Definition: MediaWikiServices.php:352
MediaWiki\MediaWikiServices\getCryptHKDF
getCryptHKDF()
Definition: MediaWikiServices.php:523
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1078
Wikimedia\Services\ServiceContainer
ServiceContainer provides a generic service to manage named services using lazy instantiation based o...
Definition: ServiceContainer.php:46
MediaWiki\MediaWikiServices\resetGlobalInstance
static resetGlobalInstance(Config $bootstrapConfig=null, $quick='')
Creates a new instance of MediaWikiServices and sets it as the global default instance.
Definition: MediaWikiServices.php:200
MediaWiki\MediaWikiServices\getWatchedItemStore
getWatchedItemStore()
Definition: MediaWikiServices.php:947
MediaWiki\MediaWikiServices\getMediaHandlerFactory
getMediaHandlerFactory()
Definition: MediaWikiServices.php:667
Config\get
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
CryptHKDF
Definition: CryptHKDF.php:33
MediaWiki\MediaWikiServices\getWatchedItemQueryService
getWatchedItemQueryService()
Definition: MediaWikiServices.php:939
MediaWiki\MediaWikiServices\getTitleParser
getTitleParser()
Definition: MediaWikiServices.php:915
WatchedItemQueryService
Definition: WatchedItemQueryService.php:18
ProxyLookup
Definition: ProxyLookup.php:27
VirtualRESTServiceClient
Virtual HTTP service client loosely styled after a Virtual File System.
Definition: VirtualRESTServiceClient.php:45
MediaWiki\Interwiki\InterwikiLookup
Service interface for looking up Interwiki records.
Definition: InterwikiLookup.php:31
MediaWiki
A helper class for throttling authentication attempts.
MediaWiki\MediaWikiServices\newSearchEngine
newSearchEngine()
Definition: MediaWikiServices.php:818
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
MediaWiki\MediaWikiServices\getMainConfig
getMainConfig()
Returns the Config object that provides configuration for MediaWiki core.
Definition: MediaWikiServices.php:643
MediaWiki\MediaWikiServices\getSearchEngineFactory
getSearchEngineFactory()
Definition: MediaWikiServices.php:835
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition: BlobStoreFactory.php:35
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:28
TitleParser
A title parser service for MediaWiki.
Definition: TitleParser.php:33
MediaWiki\MediaWikiServices\disableStorageBackend
static disableStorageBackend()
Disables all storage layer services.
Definition: MediaWikiServices.php:297
MediaWiki\MediaWikiServices\getRevisionStoreFactory
getRevisionStoreFactory()
Definition: MediaWikiServices.php:810
MediaWiki\MediaWikiServices\getDBLoadBalancerFactory
getDBLoadBalancerFactory()
Definition: MediaWikiServices.php:549
MediaWiki\MediaWikiServices\newInstance
static newInstance(Config $bootstrapConfig, $loadWiring='')
Creates a new MediaWikiServices instance and initializes it according to the given $bootstrapConfig.
Definition: MediaWikiServices.php:267
MediaWiki\MediaWikiServices\getTitleFormatter
getTitleFormatter()
Definition: MediaWikiServices.php:907
MediaWiki\MediaWikiServices\getHttpRequestFactory
getHttpRequestFactory()
Definition: MediaWikiServices.php:581
Wikimedia\Rdbms\LoadBalancer
Database connection, tracking, load balancing, and transaction manager for a cluster.
Definition: LoadBalancer.php:41
MediaWiki\MediaWikiServices\getRevisionFactory
getRevisionFactory()
Definition: MediaWikiServices.php:778
MediaWiki\MediaWikiServices\getParserCache
getParserCache()
Definition: MediaWikiServices.php:706
MediaWiki\MediaWikiServices\salvage
salvage(self $other)
Salvages the state of any salvageable service instances in $other.
Definition: MediaWikiServices.php:231
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:271
MediaWiki\MediaWikiServices\getPreferencesFactory
getPreferencesFactory()
Definition: MediaWikiServices.php:746
MediaWiki\Special\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:63
MediaWiki\MediaWikiServices\__construct
__construct(Config $config)
Definition: MediaWikiServices.php:403
Wikimedia\Services\SalvageableService
SalvageableService defines an interface for services that are able to salvage state from a previous i...
Definition: SalvageableService.php:35
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:124
Revision\RevisionRenderer
The RevisionRenderer service provides access to rendered output for revisions.
Definition: RevisionRenderer.php:45
MediaWiki\Permissions\PermissionManager
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
Definition: PermissionManager.php:43
MediaWiki\MediaWikiServices\getPasswordFactory
getPasswordFactory()
Definition: MediaWikiServices.php:722
ParserFactory
Definition: ParserFactory.php:28
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2162
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporterNoUpdates
getWikiRevisionOldRevisionImporterNoUpdates()
Definition: MediaWikiServices.php:963
MediaWiki\MediaWikiServices\getVirtualRESTServiceClient
getVirtualRESTServiceClient()
Definition: MediaWikiServices.php:931
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:31
MediaWiki\MediaWikiServices\getConfigFactory
getConfigFactory()
Definition: MediaWikiServices.php:483
MediaWiki\Shell\CommandFactory
Factory facilitating dependency injection for Command.
Definition: CommandFactory.php:32
MediaWiki\MediaWikiServices\getWikiRevisionUploadImporter
getWikiRevisionUploadImporter()
Definition: MediaWikiServices.php:971
MediaWiki\Preferences\PreferencesFactory
A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a given ...
Definition: PreferencesFactory.php:51
MediaWiki\MediaWikiServices\getRevisionRenderer
getRevisionRenderer()
Definition: MediaWikiServices.php:794
MediaWiki\Config\ConfigRepository
Object which holds currently registered configuration options.
Definition: ConfigRepository.php:33
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:35
MediaWiki\MediaWikiServices\getExternalStoreFactory
getExternalStoreFactory()
Definition: MediaWikiServices.php:565
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:49
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:34
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:33
MediaWiki\MediaWikiServices\getMainWANObjectCache
getMainWANObjectCache()
Definition: MediaWikiServices.php:659
MediaWiki\MediaWikiServices\getMimeAnalyzer
getMimeAnalyzer()
Definition: MediaWikiServices.php:675
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:10
MediaWiki\MediaWikiServices\getSiteStore
getSiteStore()
Definition: MediaWikiServices.php:859
MediaWiki\MediaWikiServices\getBlobStore
getBlobStore()
Definition: MediaWikiServices.php:426
MediaWiki\MediaWikiServices\getLocalServerObjectCache
getLocalServerObjectCache()
Definition: MediaWikiServices.php:624
OldRevisionImporter
Definition: OldRevisionImporter.php:6
MediaWiki\MediaWikiServices\getBlobStoreFactory
getBlobStoreFactory()
Definition: MediaWikiServices.php:434
MediaWiki\MediaWikiServices\getConfiguredReadOnlyMode
getConfiguredReadOnlyMode()
Definition: MediaWikiServices.php:499
MediaWiki\MediaWikiServices\getRevisionStore
getRevisionStore()
Definition: MediaWikiServices.php:802
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporter
getWikiRevisionOldRevisionImporter()
Definition: MediaWikiServices.php:955
MediaWiki\MediaWikiServices\getParser
getParser()
Definition: MediaWikiServices.php:698
MediaWiki\MediaWikiServices\resetChildProcessServices
static resetChildProcessServices()
Resets any services that may have become stale after a child process returns from after pcntl_fork().
Definition: MediaWikiServices.php:321
MediaWiki\MediaWikiServices\getSlotRoleRegistry
getSlotRoleRegistry()
Definition: MediaWikiServices.php:875
TitleFormatter
A title formatter service for MediaWiki.
Definition: TitleFormatter.php:34
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:39
MediaWiki\MediaWikiServices\getContentLanguage
getContentLanguage()
Definition: MediaWikiServices.php:507
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
MediaWiki\MediaWikiServices\getConfigRepository
getConfigRepository()
Definition: MediaWikiServices.php:491
ConfigFactory
Factory class to create Config objects.
Definition: ConfigFactory.php:31
MediaWiki\Storage\NameTableStoreFactory
Definition: NameTableStoreFactory.php:26
SearchEngineConfig
Configuration handling class for SearchEngine.
Definition: SearchEngineConfig.php:9
Revision\SlotRoleRegistry
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Definition: SlotRoleRegistry.php:48
PasswordFactory
Factory class for creating and checking Password objects.
Definition: PasswordFactory.php:28
$services
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:2220
MediaWiki\MediaWikiServices\getLinkRendererFactory
getLinkRendererFactory()
Definition: MediaWikiServices.php:616
MediaWiki\MediaWikiServices\getLinkRenderer
getLinkRenderer()
LinkRenderer instance that can be used if no custom options are needed.
Definition: MediaWikiServices.php:608
MediaWiki\MediaWikiServices\getMainObjectStash
getMainObjectStash()
Definition: MediaWikiServices.php:651
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:28
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
MediaWiki\MediaWikiServices\getLinkCache
getLinkCache()
Definition: MediaWikiServices.php:597
CryptRand
Definition: CryptRand.php:30
MediaWiki\MediaWikiServices\getReadOnlyMode
getReadOnlyMode()
Definition: MediaWikiServices.php:762
Hooks
Hooks class.
Definition: Hooks.php:34
MediaWiki\MediaWikiServices\forceGlobalInstance
static forceGlobalInstance(MediaWikiServices $services)
Replaces the global MediaWikiServices instance.
Definition: MediaWikiServices.php:150
MediaWiki\Block\BlockRestrictionStore
Definition: BlockRestrictionStore.php:33
ParserCache
In both all secondary updates will be triggered handle like object that caches derived data representing a and can trigger updates of cached copies of that e g in the links the ParserCache
Definition: pageupdater.txt:78
MediaWiki\MediaWikiServices\getStatsdDataFactory
getStatsdDataFactory()
Definition: MediaWikiServices.php:899
MediaWiki\MediaWikiServices\getNameTableStoreFactory
getNameTableStoreFactory()
Definition: MediaWikiServices.php:683