MediaWiki master
MediaWiki\MediaWikiServices Class Reference

Service locator for MediaWiki core services. More...

Inherits ServiceContainer.

Collaboration diagram for MediaWiki\MediaWikiServices:

Public Member Functions

 __construct (Config $config)
 
 disableStorage ()
 Disables all storage layer services.
 
 getActionFactory ()
 
 getActorMigration ()
 
 getActorNormalization ()
 
 getActorStore ()
 
 getActorStoreFactory ()
 
 getArchivedRevisionLookup ()
 
 getAuthManager ()
 
 getAutoblockExemptionList ()
 
 getBacklinkCacheFactory ()
 
 getBadFileLookup ()
 
 getBlobStore ()
 
 getBlobStoreFactory ()
 
 getBlockActionInfo ()
 
 getBlockErrorFormatter ()
 
 getBlockManager ()
 
 getBlockPermissionCheckerFactory ()
 
 getBlockRestrictionStore ()
 
 getBlockRestrictionStoreFactory ()
 
 getBlockUserFactory ()
 
 getBlockUtils ()
 
 getBlockUtilsFactory ()
 
 getBootstrapConfig ()
 Returns the Config object containing the bootstrap configuration.
 
 getBotPasswordStore ()
 
 getCentralIdLookup ()
 
 getCentralIdLookupFactory ()
 
 getChangeTagDefStore ()
 
 getChangeTagsStore ()
 
 getChronologyProtector ()
 
 getCollationFactory ()
 
 getCommentFormatter ()
 
 getCommentParserFactory ()
 
 getCommentStore ()
 
 getConfigFactory ()
 
 getConfigRepository ()
 
 getConfigSchema ()
 
 getConfiguredReadOnlyMode ()
 
 getConnectionProvider ()
 
 getContentHandlerFactory ()
 
 getContentLanguage ()
 
 getContentLanguageCode ()
 
 getContentModelChangeFactory ()
 
 getContentModelStore ()
 
 getContentRenderer ()
 
 getContentTransformer ()
 
 getCriticalSectionProvider ()
 
 getDatabaseBlockStore ()
 
 getDatabaseBlockStoreFactory ()
 
 getDatabaseFactory ()
 
 getDateFormatterFactory ()
 
 getDBLoadBalancer ()
 
 getDBLoadBalancerFactory ()
 
 getDBLoadBalancerFactoryConfigBuilder ()
 
 getDefaultOutputPipeline ()
 
 getDeletePageFactory ()
 
 getDomainEventDispatcher ()
 
 getDomainEventSource ()
 
 getEmailer ()
 
 getEmailUserFactory ()
 
 getEventRelayerGroup ()
 
 getExtensionRegistry ()
 
 getExternalStoreAccess ()
 
 getExternalStoreFactory ()
 
 getFileBackendGroup ()
 
 getFormatterFactory ()
 
 getGenderCache ()
 
 getGlobalIdGenerator ()
 
 getGrantsInfo ()
 
 getGrantsLocalization ()
 
 getGroupPermissionsLookup ()
 
 getHideUserUtils ()
 
 getHookContainer ()
 
 getHtmlCacheUpdater ()
 
 getHtmlTransformFactory ()
 
 getHttpRequestFactory ()
 
 getInterwikiLookup ()
 
 getIntroMessageBuilder ()
 
 getJobFactory ()
 
 getJobQueueGroup ()
 
 getJobQueueGroupFactory ()
 
 getJobRunner ()
 
 getJsonCodec ()
 
 getLanguageConverterFactory ()
 
 getLanguageFactory ()
 
 getLanguageFallback ()
 
 getLanguageNameUtils ()
 
 getLinkBatchFactory ()
 
 getLinkCache ()
 
 getLinkRenderer ()
 LinkRenderer instance that can be used if no custom options are needed.
 
 getLinkRendererFactory ()
 
 getLinksMigration ()
 
 getLinkTargetLookup ()
 
 getLintErrorChecker ()
 
 getLocalisationCache ()
 
 getLocalServerObjectCache ()
 Returns the main server-local cache, yielding EmptyBagOStuff if there is none.
 
 getLockManagerGroupFactory ()
 
 getLogFormatterFactory ()
 
 getMagicWordFactory ()
 
 getMainConfig ()
 Returns the Config object that provides configuration for MediaWiki core.
 
 getMainObjectStash ()
 Returns the main object stash, yielding EmptyBagOStuff if there is none.
 
 getMainWANObjectCache ()
 Returns the main WAN cache, yielding EmptyBagOStuff if there is none.
 
 getMediaHandlerFactory ()
 
 getMergeHistoryFactory ()
 
 getMessageCache ()
 
 getMessageFormatterFactory ()
 
 getMicroStash ()
 
 getMimeAnalyzer ()
 
 getMovePageFactory ()
 
 getNamespaceInfo ()
 
 getNameTableStoreFactory ()
 
 getObjectCacheFactory ()
 
 getObjectFactory ()
 ObjectFactory is intended for instantiating "handlers" from declarative definitions, such as Action API modules, special pages, or REST API handlers.
 
 getOldRevisionImporter ()
 
 getPageEditStash ()
 
 getPageProps ()
 
 getPageRestHelperFactory ()
 
 getPageStore ()
 
 getPageStoreFactory ()
 
 getPageUpdaterFactory ()
 
 getParser ()
 Get the main Parser instance.
 
 getParserCache ()
 
 getParserCacheFactory ()
 
 getParserFactory ()
 
 getParserOutputAccess ()
 
 getParsoidDataAccess ()
 
 getParsoidOutputStash ()
 
 getParsoidPageConfigFactory ()
 
 getParsoidParserFactory ()
 
 getParsoidSiteConfig ()
 
 getPasswordFactory ()
 
 getPasswordReset ()
 
 getPerDbNameStatsdDataFactory ()
 
 getPermissionManager ()
 
 getPingback ()
 
 getPoolCounterFactory ()
 
 getPreferencesFactory ()
 
 getPreloadedContentBuilder ()
 
 getProxyLookup ()
 
 getRateLimiter ()
 
 getReadOnlyMode ()
 
 getRedirectLookup ()
 
 getRedirectStore ()
 
 getRepoGroup ()
 
 getResourceLoader ()
 
 getRestrictionStore ()
 
 getRevertedTagUpdateManager ()
 
 getRevisionFactory ()
 
 getRevisionLookup ()
 
 getRevisionRenderer ()
 
 getRevisionStore ()
 
 getRevisionStoreFactory ()
 
 getRollbackPageFactory ()
 
 getRowCommentFormatter ()
 
 getSearchEngineConfig ()
 
 getSearchEngineFactory ()
 
 getSearchResultThumbnailProvider ()
 
 getService ( $name)
 
 getShellboxClientFactory ()
 
 getShellCommandFactory ()
 
 getSignatureValidatorFactory ()
 
 getSiteLookup ()
 
 getSiteStore ()
 
 getSkinFactory ()
 
 getSlotRoleRegistry ()
 
 getSlotRoleStore ()
 
 getSpamChecker ()
 
 getSpecialPageFactory ()
 
 getStatsdDataFactory ()
 
 getStatsFactory ()
 
 getTalkPageNotificationManager ()
 
 getTempFSFileFactory ()
 
 getTempUserConfig ()
 
 getTempUserCreator ()
 
 getTidy ()
 
 getTitleFactory ()
 
 getTitleFormatter ()
 
 getTitleMatcher ()
 
 getTitleParser ()
 
 getTracer ()
 
 getTrackingCategories ()
 
 getUnblockUserFactory ()
 
 getUndeletePageFactory ()
 
 getUploadRevisionImporter ()
 
 getUrlUtils ()
 
 getUserCache ()
 
 getUserEditTracker ()
 
 getUserFactory ()
 
 getUserGroupManager ()
 
 getUserGroupManagerFactory ()
 
 getUserIdentityLookup ()
 
 getUserIdentityUtils ()
 
 getUserNamePrefixSearch ()
 
 getUserNameUtils ()
 
 getUserOptionsLookup ()
 
 getUserOptionsManager ()
 
 getUserRegistrationLookup ()
 
 getWatchedItemQueryService ()
 
 getWatchedItemStore ()
 
 getWatchlistManager ()
 
 getWikiExporterFactory ()
 
 getWikiImporterFactory ()
 
 getWikiPageFactory ()
 
 getWikiRevisionOldRevisionImporter ()
 
 getWikiRevisionOldRevisionImporterNoUpdates ()
 
 getWikiRevisionUploadImporter ()
 
 getWRStatsFactory ()
 
 isStorageDisabled ()
 Returns true if disableStorage() has been called on this MediaWikiServices instance.
 
 newSearchEngine ()
 
 resetServiceForTesting ( $name, $destroy=true)
 Resets the given service for testing purposes.
 

Static Public Member Functions

static allowGlobalInstance ()
 Allows a global service container instance to exist.
 
static allowGlobalInstanceAfterUnitTests ()
 
static disableStorageBackend ()
 Disables all storage layer services.
 
static disallowGlobalInstanceInUnitTests ()
 
static failIfResetNotAllowed ( $method)
 Convenience method that throws an exception unless it is called during a phase in which resetting of global services is allowed.
 
static forceGlobalInstance (self $services)
 Replaces the global MediaWikiServices instance.
 
static getInstance ()
 Returns the global default instance of the top level service locator.
 
static hasInstance ()
 Returns true if an instance has already been initialized.
 
static resetChildProcessServices ()
 Resets any services that may have become stale after a child processö returns from after pcntl_fork().
 
static resetGlobalInstance (?Config $bootstrapConfig=null, $mode='reset')
 Creates a new instance of MediaWikiServices and sets it as the global default instance.
 

Detailed Description

Service locator for MediaWiki core services.

Refer to includes/ServiceWiring.php for the default implementations.

See also
Dependency Injection in docs/Injection.md for the principles of DI and how to use it MediaWiki core.
Since
1.27

Definition at line 242 of file MediaWikiServices.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\MediaWikiServices::__construct ( Config $config)
Parameters
Config$configThe Config object to be registered as the 'BootstrapConfig' service. This has to contain at least the information needed to set up the 'ConfigFactory' service.

Definition at line 683 of file MediaWikiServices.php.

Member Function Documentation

◆ allowGlobalInstance()

static MediaWiki\MediaWikiServices::allowGlobalInstance ( )
static

Allows a global service container instance to exist.

This should be called only after configuration settings have been read and extensions have been registered. Any change made to configuration after this method has been called may be ineffective or even harmful.

See also
getInstance()
Since
1.36

Definition at line 272 of file MediaWikiServices.php.

◆ allowGlobalInstanceAfterUnitTests()

static MediaWiki\MediaWikiServices::allowGlobalInstanceAfterUnitTests ( )
static
Access: internal
Should only be used in MediaWikiUnitTestCase

Definition at line 296 of file MediaWikiServices.php.

◆ disableStorage()

MediaWiki\MediaWikiServices::disableStorage ( )

Disables all storage layer services.

After calling this, any attempt to access the storage layer will result in an error. Use resetGlobalInstance() with $mode=reload to restore normal operation.

Since
1.40
Warning
This is intended for extreme situations only and should never be used while serving normal web requests. Legitimate use cases for this method include the installation process. Test fixtures may also use this, if the fixture relies on globalState.
See also
resetGlobalInstance()
resetChildProcessServices()

Definition at line 531 of file MediaWikiServices.php.

References LocalisationCache\disableBackend().

◆ disableStorageBackend()

static MediaWiki\MediaWikiServices::disableStorageBackend ( )
static

Disables all storage layer services.

After calling this, any attempt to access the storage layer will result in an error.

Since
1.28
Deprecated
since 1.40, use disableStorage() instead.
Warning
This is intended for extreme situations, see the documentation of disableStorage() for details.
See also
resetGlobalInstance()
resetChildProcessServices()

Definition at line 511 of file MediaWikiServices.php.

◆ disallowGlobalInstanceInUnitTests()

static MediaWiki\MediaWikiServices::disallowGlobalInstanceInUnitTests ( )
static
Access: internal
Should only be used in MediaWikiUnitTestCase

Definition at line 286 of file MediaWikiServices.php.

◆ failIfResetNotAllowed()

static MediaWiki\MediaWikiServices::failIfResetNotAllowed ( $method)
static

Convenience method that throws an exception unless it is called during a phase in which resetting of global services is allowed.

In general, services should not be reset individually, since that may introduce inconsistencies.

Since
1.28

This method will throw an exception if:

  • self::$resetInProgress is false (to allow all services to be reset together via resetGlobalInstance)
  • and MEDIAWIKI_INSTALL is not defined (to allow services to be reset during installation)
  • and MW_PHPUNIT_TEST is not defined (to allow services to be reset during testing)

This method is intended to be used to safeguard against accidentally resetting global service instances that are not yet managed by MediaWikiServices. It is defined here in the MediaWikiServices services class to have a central place for managing service bootstrapping and resetting.

Parameters
string$methodthe name of the caller method, as given by METHOD.
See also
resetGlobalInstance()
forceGlobalInstance()
disableStorage()

Definition at line 667 of file MediaWikiServices.php.

◆ forceGlobalInstance()

static MediaWiki\MediaWikiServices::forceGlobalInstance ( self $services)
static

Replaces the global MediaWikiServices instance.

Since
1.28
Note
This is for use in PHPUnit tests only!
Parameters
self$servicesThe new MediaWikiServices object.
Returns
self The old MediaWikiServices object, so it can be restored later.

Definition at line 371 of file MediaWikiServices.php.

◆ getActionFactory()

MediaWiki\MediaWikiServices::getActionFactory ( )
Since
1.37

Definition at line 697 of file MediaWikiServices.php.

◆ getActorMigration()

MediaWiki\MediaWikiServices::getActorMigration ( )
Since
1.31

Definition at line 704 of file MediaWikiServices.php.

◆ getActorNormalization()

MediaWiki\MediaWikiServices::getActorNormalization ( )
Since
1.36

Definition at line 711 of file MediaWikiServices.php.

◆ getActorStore()

MediaWiki\MediaWikiServices::getActorStore ( )
Since
1.36

Definition at line 718 of file MediaWikiServices.php.

◆ getActorStoreFactory()

MediaWiki\MediaWikiServices::getActorStoreFactory ( )
Since
1.36

Definition at line 725 of file MediaWikiServices.php.

◆ getArchivedRevisionLookup()

MediaWiki\MediaWikiServices::getArchivedRevisionLookup ( )
Since
1.38

Definition at line 732 of file MediaWikiServices.php.

◆ getAuthManager()

MediaWiki\MediaWikiServices::getAuthManager ( )
Since
1.35

Definition at line 739 of file MediaWikiServices.php.

◆ getAutoblockExemptionList()

MediaWiki\MediaWikiServices::getAutoblockExemptionList ( )
Since
1.42

Definition at line 746 of file MediaWikiServices.php.

◆ getBacklinkCacheFactory()

MediaWiki\MediaWikiServices::getBacklinkCacheFactory ( )
Since
1.37

Definition at line 753 of file MediaWikiServices.php.

◆ getBadFileLookup()

MediaWiki\MediaWikiServices::getBadFileLookup ( )
Since
1.34

Definition at line 760 of file MediaWikiServices.php.

◆ getBlobStore()

MediaWiki\MediaWikiServices::getBlobStore ( )
Since
1.31

Definition at line 767 of file MediaWikiServices.php.

◆ getBlobStoreFactory()

MediaWiki\MediaWikiServices::getBlobStoreFactory ( )
Since
1.31

Definition at line 774 of file MediaWikiServices.php.

◆ getBlockActionInfo()

MediaWiki\MediaWikiServices::getBlockActionInfo ( )
Since
1.37

Definition at line 781 of file MediaWikiServices.php.

◆ getBlockErrorFormatter()

MediaWiki\MediaWikiServices::getBlockErrorFormatter ( )
Since
1.35
Deprecated
since 1.42, use getFormatterFactory()->getBlockErrorFormatter() instead.

Definition at line 789 of file MediaWikiServices.php.

◆ getBlockManager()

MediaWiki\MediaWikiServices::getBlockManager ( )
Since
1.34

Definition at line 797 of file MediaWikiServices.php.

◆ getBlockPermissionCheckerFactory()

MediaWiki\MediaWikiServices::getBlockPermissionCheckerFactory ( )
Since
1.35

Definition at line 804 of file MediaWikiServices.php.

◆ getBlockRestrictionStore()

MediaWiki\MediaWikiServices::getBlockRestrictionStore ( )
Since
1.33

Definition at line 811 of file MediaWikiServices.php.

◆ getBlockRestrictionStoreFactory()

MediaWiki\MediaWikiServices::getBlockRestrictionStoreFactory ( )
Since
1.38

Definition at line 818 of file MediaWikiServices.php.

◆ getBlockUserFactory()

MediaWiki\MediaWikiServices::getBlockUserFactory ( )
Since
1.36

Definition at line 825 of file MediaWikiServices.php.

◆ getBlockUtils()

MediaWiki\MediaWikiServices::getBlockUtils ( )
Since
1.36

Definition at line 832 of file MediaWikiServices.php.

◆ getBlockUtilsFactory()

MediaWiki\MediaWikiServices::getBlockUtilsFactory ( )
Since
1.42

Definition at line 839 of file MediaWikiServices.php.

◆ getBootstrapConfig()

MediaWiki\MediaWikiServices::getBootstrapConfig ( )

Returns the Config object containing the bootstrap configuration.

Bootstrap configuration would typically include database credentials and other information that may be needed before the ConfigFactory service can be instantiated.

Note
This should only be used during bootstrapping, in particular when creating the MainConfig service. Application logic should use getMainConfig() to get a Config instances.
Since
1.27

Definition at line 855 of file MediaWikiServices.php.

◆ getBotPasswordStore()

MediaWiki\MediaWikiServices::getBotPasswordStore ( )
Since
1.37

Definition at line 862 of file MediaWikiServices.php.

◆ getCentralIdLookup()

MediaWiki\MediaWikiServices::getCentralIdLookup ( )
Since
1.37

Definition at line 869 of file MediaWikiServices.php.

◆ getCentralIdLookupFactory()

MediaWiki\MediaWikiServices::getCentralIdLookupFactory ( )
Since
1.37

Definition at line 876 of file MediaWikiServices.php.

◆ getChangeTagDefStore()

MediaWiki\MediaWikiServices::getChangeTagDefStore ( )
Since
1.32

Definition at line 883 of file MediaWikiServices.php.

◆ getChangeTagsStore()

MediaWiki\MediaWikiServices::getChangeTagsStore ( )
Since
1.41

Definition at line 890 of file MediaWikiServices.php.

◆ getChronologyProtector()

MediaWiki\MediaWikiServices::getChronologyProtector ( )
Since
1.41

Definition at line 897 of file MediaWikiServices.php.

◆ getCollationFactory()

MediaWiki\MediaWikiServices::getCollationFactory ( )
Since
1.37

Definition at line 904 of file MediaWikiServices.php.

◆ getCommentFormatter()

MediaWiki\MediaWikiServices::getCommentFormatter ( )
Since
1.38

Definition at line 911 of file MediaWikiServices.php.

◆ getCommentParserFactory()

MediaWiki\MediaWikiServices::getCommentParserFactory ( )
Since
1.41

Definition at line 918 of file MediaWikiServices.php.

◆ getCommentStore()

MediaWiki\MediaWikiServices::getCommentStore ( )
Since
1.31

Definition at line 925 of file MediaWikiServices.php.

◆ getConfigFactory()

MediaWiki\MediaWikiServices::getConfigFactory ( )
Since
1.27

Definition at line 932 of file MediaWikiServices.php.

◆ getConfigRepository()

MediaWiki\MediaWikiServices::getConfigRepository ( )
Deprecated
since 1.42. Unused.
Since
1.32

Definition at line 940 of file MediaWikiServices.php.

◆ getConfigSchema()

MediaWiki\MediaWikiServices::getConfigSchema ( )
Since
1.39

Definition at line 948 of file MediaWikiServices.php.

◆ getConfiguredReadOnlyMode()

MediaWiki\MediaWikiServices::getConfiguredReadOnlyMode ( )
Since
1.29
Deprecated
since 1.41 use ::getReadOnlyMode() instead

Definition at line 956 of file MediaWikiServices.php.

◆ getConnectionProvider()

MediaWiki\MediaWikiServices::getConnectionProvider ( )
Since
1.42

Definition at line 963 of file MediaWikiServices.php.

◆ getContentHandlerFactory()

MediaWiki\MediaWikiServices::getContentHandlerFactory ( )
Since
1.35

Definition at line 970 of file MediaWikiServices.php.

◆ getContentLanguage()

MediaWiki\MediaWikiServices::getContentLanguage ( )
Since
1.32

Definition at line 977 of file MediaWikiServices.php.

◆ getContentLanguageCode()

MediaWiki\MediaWikiServices::getContentLanguageCode ( )
Since
1.43

Definition at line 984 of file MediaWikiServices.php.

◆ getContentModelChangeFactory()

MediaWiki\MediaWikiServices::getContentModelChangeFactory ( )
Since
1.35

Definition at line 991 of file MediaWikiServices.php.

◆ getContentModelStore()

MediaWiki\MediaWikiServices::getContentModelStore ( )
Since
1.31

Definition at line 998 of file MediaWikiServices.php.

◆ getContentRenderer()

MediaWiki\MediaWikiServices::getContentRenderer ( )
Since
1.38

Definition at line 1005 of file MediaWikiServices.php.

Referenced by MediaWiki\EditPage\EditPage\doPreviewParse().

◆ getContentTransformer()

MediaWiki\MediaWikiServices::getContentTransformer ( )

◆ getCriticalSectionProvider()

MediaWiki\MediaWikiServices::getCriticalSectionProvider ( )
Since
1.36

Definition at line 1019 of file MediaWikiServices.php.

◆ getDatabaseBlockStore()

MediaWiki\MediaWikiServices::getDatabaseBlockStore ( )
Since
1.36

Definition at line 1026 of file MediaWikiServices.php.

◆ getDatabaseBlockStoreFactory()

MediaWiki\MediaWikiServices::getDatabaseBlockStoreFactory ( )
Since
1.40

Definition at line 1033 of file MediaWikiServices.php.

◆ getDatabaseFactory()

MediaWiki\MediaWikiServices::getDatabaseFactory ( )
Since
1.39

Definition at line 1040 of file MediaWikiServices.php.

◆ getDateFormatterFactory()

MediaWiki\MediaWikiServices::getDateFormatterFactory ( )
Since
1.33

Definition at line 1047 of file MediaWikiServices.php.

◆ getDBLoadBalancer()

MediaWiki\MediaWikiServices::getDBLoadBalancer ( )
Since
1.28
Returns
ILoadBalancer The main DB load balancer for the local wiki.

Definition at line 1055 of file MediaWikiServices.php.

◆ getDBLoadBalancerFactory()

MediaWiki\MediaWikiServices::getDBLoadBalancerFactory ( )
Since
1.28
Note
When possible, use getConnectionProvider() instead.

Definition at line 1063 of file MediaWikiServices.php.

◆ getDBLoadBalancerFactoryConfigBuilder()

MediaWiki\MediaWikiServices::getDBLoadBalancerFactoryConfigBuilder ( )
Since
1.39

Definition at line 1070 of file MediaWikiServices.php.

◆ getDefaultOutputPipeline()

MediaWiki\MediaWikiServices::getDefaultOutputPipeline ( )
Returns
OutputTransformPipeline
Access: internal

Definition at line 1078 of file MediaWikiServices.php.

◆ getDeletePageFactory()

MediaWiki\MediaWikiServices::getDeletePageFactory ( )
Since
1.37

Definition at line 1085 of file MediaWikiServices.php.

◆ getDomainEventDispatcher()

MediaWiki\MediaWikiServices::getDomainEventDispatcher ( )
Since
1.44
Stability: unstable
until 1.45

Definition at line 1093 of file MediaWikiServices.php.

◆ getDomainEventSource()

MediaWiki\MediaWikiServices::getDomainEventSource ( )
Since
1.44
Stability: unstable
until 1.45

Definition at line 1101 of file MediaWikiServices.php.

◆ getEmailer()

MediaWiki\MediaWikiServices::getEmailer ( )
Since
1.35

Definition at line 1108 of file MediaWikiServices.php.

◆ getEmailUserFactory()

MediaWiki\MediaWikiServices::getEmailUserFactory ( )
Since
1.41

Definition at line 1115 of file MediaWikiServices.php.

◆ getEventRelayerGroup()

MediaWiki\MediaWikiServices::getEventRelayerGroup ( )
Since
1.27

Definition at line 1122 of file MediaWikiServices.php.

◆ getExtensionRegistry()

MediaWiki\MediaWikiServices::getExtensionRegistry ( )
Since
1.42

Definition at line 1129 of file MediaWikiServices.php.

◆ getExternalStoreAccess()

MediaWiki\MediaWikiServices::getExternalStoreAccess ( )
Since
1.34

Definition at line 1136 of file MediaWikiServices.php.

◆ getExternalStoreFactory()

MediaWiki\MediaWikiServices::getExternalStoreFactory ( )
Since
1.31

Definition at line 1143 of file MediaWikiServices.php.

◆ getFileBackendGroup()

MediaWiki\MediaWikiServices::getFileBackendGroup ( )
Since
1.35

Definition at line 1150 of file MediaWikiServices.php.

◆ getFormatterFactory()

MediaWiki\MediaWikiServices::getFormatterFactory ( )
Since
1.41

Definition at line 1157 of file MediaWikiServices.php.

◆ getGenderCache()

MediaWiki\MediaWikiServices::getGenderCache ( )
Since
1.28

Definition at line 1164 of file MediaWikiServices.php.

◆ getGlobalIdGenerator()

MediaWiki\MediaWikiServices::getGlobalIdGenerator ( )
Since
1.35

Definition at line 1171 of file MediaWikiServices.php.

◆ getGrantsInfo()

MediaWiki\MediaWikiServices::getGrantsInfo ( )
Since
1.38

Definition at line 1178 of file MediaWikiServices.php.

◆ getGrantsLocalization()

MediaWiki\MediaWikiServices::getGrantsLocalization ( )
Since
1.38

Definition at line 1185 of file MediaWikiServices.php.

◆ getGroupPermissionsLookup()

MediaWiki\MediaWikiServices::getGroupPermissionsLookup ( )
Since
1.36

Definition at line 1192 of file MediaWikiServices.php.

◆ getHideUserUtils()

MediaWiki\MediaWikiServices::getHideUserUtils ( )
Since
1.42
Returns
HideUserUtils

Definition at line 1200 of file MediaWikiServices.php.

◆ getHookContainer()

MediaWiki\MediaWikiServices::getHookContainer ( )
Since
1.35

Definition at line 1207 of file MediaWikiServices.php.

Referenced by MediaWiki\EditPage\EditPage\getCopyrightWarning().

◆ getHtmlCacheUpdater()

MediaWiki\MediaWikiServices::getHtmlCacheUpdater ( )
Since
1.35

Definition at line 1214 of file MediaWikiServices.php.

◆ getHtmlTransformFactory()

MediaWiki\MediaWikiServices::getHtmlTransformFactory ( )
Since
1.39

Definition at line 1221 of file MediaWikiServices.php.

◆ getHttpRequestFactory()

MediaWiki\MediaWikiServices::getHttpRequestFactory ( )
Since
1.31

Definition at line 1228 of file MediaWikiServices.php.

◆ getInstance()

static MediaWiki\MediaWikiServices::getInstance ( )
static

Returns the global default instance of the top level service locator.

Note
if called before allowGlobalInstance(), this method will fail.
Since
1.27

The default instance is initialized using the service instantiator functions defined in ServiceWiring.php.

Note
This should only be called by static functions! The instance returned here should not be passed around! Objects that need access to a service should have that service injected into the constructor, never a service locator!

Definition at line 325 of file MediaWikiServices.php.

References wfDeprecatedMsg().

Referenced by MediaWiki\Language\Language\__construct(), MediaWiki\Api\ApiMain\__construct(), MediaWiki\Site\MediaWikiPageNameNormalizer\__construct(), MediaWiki\Parser\MagicWord\__construct(), MediaWiki\Pager\LogPager\__construct(), MediaWiki\SpecialPage\SpecialRedirectWithAction\__construct(), MediaWiki\SpecialPage\ChangesListSpecialPage\__construct(), MediaWiki\Parser\MagicWordArray\__construct(), MediaWiki\RenameUser\RenameuserSQL\__construct(), MediaWiki\Session\SessionManager\__construct(), MediaWiki\HTMLForm\Field\HTMLSelectLanguageField\__construct(), MediaWiki\HTMLForm\Field\HTMLTimezoneField\__construct(), MediaWiki\Auth\ThrottlePreAuthenticationProvider\__construct(), MediaWiki\ResourceLoader\ForeignResourceManager\__construct(), MediaWiki\Utils\GitInfo\__construct(), MediaWiki\Installer\CliInstaller\__construct(), MediaWiki\Html\TemplateParser\__construct(), MediaWiki\Feed\FeedItem\__construct(), MediaWiki\Cache\FileCacheBase\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\Specials\SpecialAllPages\__construct(), MediaWiki\__construct(), MediaWiki\Pager\IndexPager\__construct(), MediaWiki\Cache\GenderCache\__construct(), MediaWiki\Specials\SpecialPreferences\__construct(), MediaWiki\Specials\SpecialUpload\__construct(), MediaWiki\Specials\SpecialUserRights\__construct(), MediaWiki\Specials\SpecialRecentChanges\__construct(), MediaWiki\Specials\SpecialEditWatchlist\__construct(), MediaWiki\Api\ApiPageSet\__construct(), MediaWiki\Api\ApiAuthManagerHelper\__construct(), MediaWiki\Api\ApiModuleManager\__construct(), MediaWiki\Api\ApiOptions\__construct(), MediaWiki\Api\ApiEditPage\__construct(), MediaWiki\Api\ApiQueryImageInfo\__construct(), MediaWiki\Api\ApiQueryRevisionsBase\__construct(), MediaWiki\Api\ApiErrorFormatter_BackCompat\__construct(), MediaWiki\EditPage\EditPage\__construct(), MediaWiki\Page\ProtectionForm\__construct(), MediaWiki\Actions\FileDeleteAction\__construct(), MediaWiki\ResourceLoader\ResourceLoader\__construct(), MediaWiki\Pager\HistoryPager\__construct(), MediaWiki\Pager\ContribsPager\__construct(), MediaWiki\Category\CategoryViewer\__construct(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\__construct(), MediaWiki\ResourceLoader\MessageBlobStore\__construct(), MediaWiki\RevisionList\RevisionItem\__construct(), MediaWiki\Preferences\DefaultPreferencesFactory\__construct(), MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\PHPSessionHandler\__construct(), MediaWiki\Deferred\JobQueueEnqueueUpdate\__construct(), MediaWiki\PoolCounter\PoolCounterWork\__construct(), MediaWiki\User\User\__get(), MediaWiki\User\User\__set(), MediaWiki\Category\CategoryViewer\addSubcategoryObject(), MediaWiki\User\ExternalUserNames\applyPrefix(), MediaWiki\SiteStats\SiteStatsInit\articles(), MediaWiki\SpecialPage\ChangesListSpecialPage\buildQuery(), MediaWiki\EditPage\TextboxBuilder\buildTextboxAttribs(), MediaWiki\Deferred\SiteStatsUpdate\cacheUpdate(), MediaWiki\Specials\SpecialPageLanguage\changePageLanguage(), MediaWiki\User\User\checkAndSetTouched(), MediaWiki\Api\ApiMain\checkAsserts(), MediaWiki\Feed\FeedUtils\checkFeedOutput(), MediaWiki\User\User\checkPasswordValidity(), MediaWiki\Api\ApiMain\checkReadOnly(), MediaWiki\SpecialPage\SpecialPage\checkReadOnly(), MediaWiki\Specials\SpecialWatchlist\checkStructuredFilterUiEnabled(), MediaWiki\User\User\clearInstanceCache(), MediaWiki\Api\ApiFormatBase\closePrinter(), MediaWiki\SpecialPage\ChangesListSpecialPage\considerActionsForDefaultSavedQuery(), MediaWiki\Output\StreamFile\contentTypeFromPath(), MediaWiki\Content\AbstractContent\convert(), MediaWiki\Block\DatabaseBlock\delete(), MediaWiki\Content\TextContent\diff(), MediaWiki\Installer\Installer\dirIsExecutable(), MediaWiki\Installer\Installer\disableStorage(), MediaWiki\Parser\CoreParserFunctions\displaytitle(), MediaWiki\Block\DatabaseBlock\doAutoblock(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), MediaWiki\SpecialPage\ChangesListSpecialPage\doMainQuery(), MediaWiki\RevisionList\RevisionList\doQuery(), MediaWiki\Deferred\CdnCacheUpdate\doUpdate(), MediaWiki\Deferred\SiteStatsUpdate\doUpdate(), MediaWiki\Deferred\UserEditCountUpdate\doUpdate(), MediaWiki\Language\MessageCacheUpdate\doUpdate(), MediaWiki\Search\SearchUpdate\doUpdate(), MediaWiki\Parser\LinkHolderArray\doVariants(), MediaWiki\PoolCounter\PoolWorkArticleViewCurrent\doWork(), MediaWiki\PoolCounter\PoolWorkArticleViewOld\doWork(), MediaWiki\EditPage\EditPage\edit(), MediaWiki\Xml\Xml\elementClean(), MediaWiki\Installer\Installer\envCheckUploadsServerResponse(), MediaWiki\Specials\SpecialMIMESearch\execute(), MediaWiki\SpecialPage\ChangesListSpecialPage\execute(), MediaWiki\SpecialPage\LoginSignupSpecialPage\execute(), MediaWiki\Specials\SpecialExpandTemplates\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Installer\WebInstallerLanguage\execute(), MediaWiki\Api\ApiQueryBase\executeGenderCacheFromResultWrapper(), MediaWiki\ResourceLoader\FileModule\extractBasePaths(), MediaWiki\User\CentralId\CentralIdLookup\factory(), MediaWiki\Content\CssContentHandler\fillParserOutput(), MediaWiki\Content\JavaScriptContentHandler\fillParserOutput(), MediaWiki\Content\TextContentHandler\fillParserOutput(), MediaWiki\User\User\findUsersByGroup(), MediaWiki\Parser\CoreParserFunctions\formatDate(), MediaWiki\Feed\FeedUtils\formatDiff(), MediaWiki\Feed\FeedUtils\formatDiffRow(), MediaWiki\Feed\FeedUtils\formatDiffRow2(), MediaWiki\Api\ApiResult\formatExpiry(), MediaWiki\Parser\CoreParserFunctions\formatRaw(), MediaWiki\Parser\CoreParserFunctions\gender(), MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail(), MediaWiki\Deferred\LinksUpdate\LinksTableGroup\get(), MediaWiki\Installer\WebInstaller\getAcceptLanguage(), MediaWiki\Content\ContentHandler\getAllContentFormats(), MediaWiki\Api\ApiFeedContributions\getAllowedParams(), MediaWiki\SpecialPage\SpecialPage\getAuthManager(), MediaWiki\User\User\getCacheKey(), MediaWiki\WikiMap\WikiMap\getCanonicalServerInfoForAllWikis(), MediaWiki\Api\ApiQueryUserInfo\getCentralUserInfo(), MediaWiki\Context\RequestContext\getConfig(), MediaWiki\ResourceLoader\WikiModule\getContent(), MediaWiki\Content\ContentHandler\getContentModels(), MediaWiki\ResourceLoader\WikiModule\getContentObj(), MediaWiki\Request\FauxRequest\getCookie(), MediaWiki\Installer\WebInstallerOutput\getCSS(), MediaWiki\Pager\AllMessagesTablePager\getCustomisedStatuses(), MediaWiki\Content\FileContentHandler\getDataForSearchIndex(), MediaWiki\Api\ApiBase\getDB(), MediaWiki\ResourceLoader\WikiModule\getDB(), MediaWiki\SpecialPage\QueryPage\getDBLoadBalancer(), MediaWiki\Content\ContentHandler\getDefaultModelFor(), MediaWiki\Specials\SpecialVersion\getExtensionTypes(), MediaWiki\SpecialPage\LoginSignupSpecialPage\getFieldDefinitions(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\Api\ApiFormatBase\getFilename(), MediaWiki\ResourceLoader\Module\getFlip(), MediaWiki\Content\ContentHandler\getForContent(), MediaWiki\Content\ContentHandler\getForModelID(), MediaWiki\Api\ApiHelp\getHelp(), MediaWiki\Api\ApiBase\getHookContainer(), MediaWiki\RevisionList\RevisionItem\getHTML(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\Api\ApiQueryImageInfo\getInfo(), MediaWiki\Specials\SpecialUpload\getInitialPageText(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), MediaWiki\Parser\DateFormatter\getInstance(), MediaWiki\Linker\Linker\getInvalidTitleDescription(), MediaWiki\Feed\FeedItem\getLanguage(), MediaWiki\SpecialPage\PageQueryPage\getLanguageConverter(), MediaWiki\Installer\WebInstallerLanguage\getLanguageSelector(), MediaWiki\RCFeed\IRCColourfulRCFeedFormatter\getLine(), MediaWiki\RCFeed\MachineReadableRCFeedFormatter\getLine(), MediaWiki\SpecialPage\QueryPage\getLinkBatchFactory(), MediaWiki\RevisionList\RevisionItemBase\getLinkRenderer(), MediaWiki\Utils\MWTimestamp\getLocalInstance(), MediaWiki\Specials\SpecialLog\getLogTypesOnUser(), MediaWiki\Rest\EntryPoint\getMainRequest(), MediaWiki\Cache\FileCacheBase\getMissesRecent(), MediaWiki\Request\WebRequestUpload\getName(), MediaWiki\Api\ApiOpenSearch\getOpenSearchTemplate(), MediaWiki\Content\CodeContentHandler\getPageLanguage(), MediaWiki\Content\ContentHandler\getPageLanguage(), MediaWiki\SpecialPage\QueryPage\getPages(), MediaWiki\ResourceLoader\UserModule\getPages(), MediaWiki\ResourceLoader\UserStylesModule\getPages(), MediaWiki\Content\CodeContentHandler\getPageViewLanguage(), MediaWiki\Content\ContentHandler\getPageViewLanguage(), MediaWiki\Request\WebRequest\getPathInfo(), MediaWiki\Password\UserPasswordPolicy\getPoliciesForUser(), MediaWiki\ExternalLinks\LinkFilter\getProtocolPrefix(), MediaWiki\Session\SessionManager\getProviders(), MediaWiki\ExternalLinks\LinkFilter\getQueryConditions(), MediaWiki\Block\DatabaseBlock\getQueryInfo(), MediaWiki\Pager\LogPager\getQueryInfo(), MediaWiki\Pager\ContributionsPager\getQueryInfo(), MediaWiki\Pager\MergeHistoryPager\getQueryInfo(), MediaWiki\Block\DatabaseBlock\getRangeCond(), MediaWiki\SpecialPage\ChangesListSpecialPage\getRcFiltersConfigSummary(), MediaWiki\SpecialPage\ChangesListSpecialPage\getRcFiltersConfigVars(), MediaWiki\Utils\MWTimestamp\getRelativeTimestamp(), MediaWiki\Skin\SkinComponentUtils\getReturnToParam(), MediaWiki\Api\ApiRsd\getRsdApiList(), MediaWiki\SpecialPage\SpecialPage\getSafeTitleFor(), MediaWiki\ResourceLoader\UserOptionsModule\getScript(), MediaWiki\Content\WikitextContent\getSection(), MediaWiki\Cache\LinkCache\getSelectFields(), MediaWiki\Specials\SpecialEmailUser\getTarget(), MediaWiki\Html\TemplateParser\getTemplate(), MediaWiki\EditPage\TextboxBuilder\getTextboxProtectionCSSClasses(), MediaWiki\Content\TextContent\getTextForSummary(), MediaWiki\Api\ApiBase\getTitleOrPageId(), MediaWiki\SpecialPage\SpecialPage\getTitleValueFor(), MediaWiki\Api\ApiQueryTokens\getTokenTypeSalts(), MediaWiki\Linker\Linker\getUploadUrl(), MediaWiki\Session\UserInfo\getUser(), MediaWiki\User\ExternalUserNames\getUserLinkTitle(), MediaWiki\Api\ApiBase\getWatchlistUser(), MediaWiki\Context\DerivativeContext\getWikiPage(), MediaWiki\Context\RequestContext\getWikiPage(), MediaWiki\Output\OutputHandler\handle(), MediaWiki\LinkedData\PageDataRequestHandler\handleRequest(), MediaWiki\Parser\CoreTagHooks\html(), MediaWiki\Html\Html\htmlHeader(), MediaWiki\LinkedData\PageDataRequestHandler\httpContentNegotiation(), MediaWiki\Feed\ChannelFeed\httpHeaders(), MediaWiki\SpecialPage\ChangesListSpecialPage\includeRcFiltersApp(), MediaWiki\Cache\FileCacheBase\incrMissesRecent(), MediaWiki\Block\DatabaseBlock\insert(), MediaWiki\Parser\LinkHolderArray\isBig(), MediaWiki\Content\TextContent\isCountable(), MediaWiki\Content\WikitextContent\isCountable(), MediaWiki\Block\DatabaseBlock\isExemptedFromAutoblocks(), MediaWiki\User\User\isPingLimitable(), MediaWiki\SpecialPage\SpecialPage\isRestricted(), MediaWiki\SiteStats\SiteStats\jobs(), MediaWiki\Parser\CoreParserFunctions\language(), MediaWiki\Xml\Xml\languageSelector(), MediaWiki\Linker\Linker\link(), MediaWiki\Html\Html\linkedScript(), MediaWiki\Revision\ArchivedRevisionLookup\listRevisions(), MediaWiki\User\User\load(), MediaWiki\SpecialPage\LoginSignupSpecialPage\load(), MediaWiki\SiteStats\SiteStats\loadAndLazyInit(), MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField\loadDataFromRequest(), MediaWiki\User\User\loadFromCache(), MediaWiki\User\User\loadFromDatabase(), MediaWiki\User\User\loadFromRow(), MediaWiki\Session\SessionManager\logPotentialSessionLeakage(), MediaWiki\Api\ApiMain\logRequest(), MediaWiki\SpecialPage\LoginSignupSpecialPage\mainLoginForm(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Content\ContentHandler\makeContent(), MediaWiki\Linker\Linker\makeExternalImage(), MediaWiki\Linker\Linker\makeExternalLink(), MediaWiki\WikiMap\WikiMap\makeForeignLink(), MediaWiki\Linker\Linker\makeImageLink(), MediaWiki\ExternalLinks\LinkFilter\makeIndexes(), MediaWiki\SpecialPage\LoginSignupSpecialPage\makeLanguageSelectorLink(), MediaWiki\ExternalLinks\LinkFilter\makeLikeArray(), MediaWiki\Linker\Linker\makeMediaLinkFile(), MediaWiki\Linker\Linker\makeMediaLinkObj(), MediaWiki\Linker\Linker\makeSelfLinkObj(), MediaWiki\Linker\Linker\makeThumbLink2(), MediaWiki\Api\ApiMain\modifyHelp(), MediaWiki\Html\Html\namespaceSelectorOptions(), MediaWiki\Site\Site\newForType(), MediaWiki\User\User\newFromActorId(), MediaWiki\User\User\newFromAnyId(), MediaWiki\User\User\newFromConfirmationCode(), MediaWiki\Block\DatabaseBlock\newFromID(), MediaWiki\User\User\newFromId(), MediaWiki\Session\UserInfo\newFromId(), MediaWiki\User\User\newFromIdentity(), MediaWiki\User\UserArray\newFromIDs(), MediaWiki\User\User\newFromName(), MediaWiki\Session\UserInfo\newFromName(), MediaWiki\User\UserArray\newFromNames(), MediaWiki\User\UserArray\newFromResult(), MediaWiki\Block\DatabaseBlock\newFromRow(), MediaWiki\User\ActorMigration\newMigration(), MediaWiki\User\ActorMigration\newMigrationForImport(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), MediaWiki\SpecialPage\SpecialPage\newSearchPage(), MediaWiki\User\User\newSystemUser(), MediaWiki\CommentStore\CommentStoreComment\newUnsavedComment(), MediaWiki\Request\WebRequest\normalizeUnicode(), MediaWiki\SiteStats\SiteStats\numberingroup(), MediaWiki\Utils\MWTimestamp\offsetForUser(), MediaWiki\Feed\AtomFeed\outItem(), MediaWiki\Parser\CoreParserFunctions\pagesincategory(), MediaWiki\SiteStats\SiteStats\pagesInNs(), MediaWiki\Installer\Installer\parse(), MediaWiki\Api\ApiQueryBase\parsePrefixedTitlePart(), MediaWiki\Installer\DatabaseUpdater\patchPath(), MediaWiki\Maintenance\ForkController\prepareEnvironment(), MediaWiki\ExternalLinks\LinkFilter\prepareProtocols(), MediaWiki\Linker\Linker\processResponsiveImages(), MediaWiki\Parser\CoreParserFunctions\protectionexpiry(), MediaWiki\Parser\CoreParserFunctions\protectionlevel(), MediaWiki\User\User\purge(), MediaWiki\Deferred\CdnCacheUpdate\purge(), MediaWiki\Installer\DatabaseUpdater\purgeCache(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable(), MediaWiki\ResourceLoader\MessageBlobStore\recacheMessageBlob(), MediaWiki\SiteStats\SiteStatsInit\refresh(), MediaWiki\SpecialPage\ChangesListSpecialPage\registerFilters(), MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\render(), MediaWiki\PoolCounter\PoolWorkArticleView\renderRevision(), MediaWiki\Parser\LinkHolderArray\replaceInternal(), MediaWiki\Content\WikitextContent\replaceSection(), MediaWiki\Api\ApiImportReporter\reportPage(), MediaWiki\ExternalLinks\LinkFilter\reverseIndexes(), MediaWiki\Watchlist\ClearUserWatchlistJob\run(), MediaWiki\Watchlist\ClearWatchlistNotificationsJob\run(), MediaWiki\Watchlist\WatchlistExpiryJob\run(), MediaWiki\Request\WebResponse\setCookie(), MediaWiki\Request\FauxRequest\setCookies(), MediaWiki\Installer\DatabaseUpdater\setFileAccess(), MediaWiki\Site\Site\setLanguageCode(), MediaWiki\Api\ApiMain\setRequestExpectations(), MediaWiki\Installer\WebInstaller\setupLanguage(), MediaWiki\Cache\UserCache\singleton(), MediaWiki\Installer\MysqlSettingsForm\submit(), MediaWiki\Installer\WebInstallerName\submit(), MediaWiki\Api\ApiMain\substituteResultWithError(), MediaWiki\Parser\MWTidy\tidy(), MediaWiki\Block\DatabaseBlock\update(), MediaWiki\Search\SearchUpdate\updateText(), MediaWiki\Block\DatabaseBlock\updateTimestamp(), MediaWiki\Watchlist\ActivityUpdateJob\updateWatchlistNotification(), MediaWiki\SpecialPage\SpecialPage\userCanExecute(), MediaWiki\Linker\Linker\userLink(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\validate(), MediaWiki\HTMLForm\Field\HTMLRestrictionsField\validate(), MediaWiki\HTMLForm\Field\HTMLTitleTextField\validate(), MediaWiki\HTMLForm\Field\HTMLUserTextField\validate(), MediaWiki\User\User\whoIs(), and MediaWiki\User\User\whoIsReal().

◆ getInterwikiLookup()

MediaWiki\MediaWikiServices::getInterwikiLookup ( )
Since
1.28

Definition at line 1235 of file MediaWikiServices.php.

◆ getIntroMessageBuilder()

MediaWiki\MediaWikiServices::getIntroMessageBuilder ( )
Since
1.41

Definition at line 1242 of file MediaWikiServices.php.

◆ getJobFactory()

MediaWiki\MediaWikiServices::getJobFactory ( )
Since
1.40

Definition at line 1249 of file MediaWikiServices.php.

◆ getJobQueueGroup()

MediaWiki\MediaWikiServices::getJobQueueGroup ( )
Since
1.37

Definition at line 1256 of file MediaWikiServices.php.

◆ getJobQueueGroupFactory()

MediaWiki\MediaWikiServices::getJobQueueGroupFactory ( )
Since
1.37

Definition at line 1263 of file MediaWikiServices.php.

◆ getJobRunner()

MediaWiki\MediaWikiServices::getJobRunner ( )
Since
1.35

Definition at line 1270 of file MediaWikiServices.php.

◆ getJsonCodec()

MediaWiki\MediaWikiServices::getJsonCodec ( )
Since
1.36

Definition at line 1277 of file MediaWikiServices.php.

◆ getLanguageConverterFactory()

MediaWiki\MediaWikiServices::getLanguageConverterFactory ( )
Since
1.35

Definition at line 1284 of file MediaWikiServices.php.

◆ getLanguageFactory()

MediaWiki\MediaWikiServices::getLanguageFactory ( )
Since
1.35

Definition at line 1291 of file MediaWikiServices.php.

◆ getLanguageFallback()

MediaWiki\MediaWikiServices::getLanguageFallback ( )
Since
1.35

Definition at line 1298 of file MediaWikiServices.php.

◆ getLanguageNameUtils()

MediaWiki\MediaWikiServices::getLanguageNameUtils ( )
Since
1.34

Definition at line 1305 of file MediaWikiServices.php.

◆ getLinkBatchFactory()

MediaWiki\MediaWikiServices::getLinkBatchFactory ( )
Since
1.35

Definition at line 1312 of file MediaWikiServices.php.

◆ getLinkCache()

MediaWiki\MediaWikiServices::getLinkCache ( )
Since
1.28

Definition at line 1319 of file MediaWikiServices.php.

◆ getLinkRenderer()

MediaWiki\MediaWikiServices::getLinkRenderer ( )

LinkRenderer instance that can be used if no custom options are needed.

Since
1.28

Definition at line 1329 of file MediaWikiServices.php.

◆ getLinkRendererFactory()

MediaWiki\MediaWikiServices::getLinkRendererFactory ( )
Since
1.28

Definition at line 1336 of file MediaWikiServices.php.

◆ getLinksMigration()

MediaWiki\MediaWikiServices::getLinksMigration ( )
Since
1.39

Definition at line 1343 of file MediaWikiServices.php.

◆ getLinkTargetLookup()

MediaWiki\MediaWikiServices::getLinkTargetLookup ( )
Since
1.38

Definition at line 1350 of file MediaWikiServices.php.

◆ getLintErrorChecker()

MediaWiki\MediaWikiServices::getLintErrorChecker ( )
Since
1.43

Definition at line 1357 of file MediaWikiServices.php.

◆ getLocalisationCache()

MediaWiki\MediaWikiServices::getLocalisationCache ( )
Since
1.34

Definition at line 1364 of file MediaWikiServices.php.

◆ getLocalServerObjectCache()

MediaWiki\MediaWikiServices::getLocalServerObjectCache ( )

Returns the main server-local cache, yielding EmptyBagOStuff if there is none.

In web request mode, the cache should at least be shared among web workers. In CLI mode, the cache should at least be shared among processes run by the same user.

Since
1.28

Definition at line 1376 of file MediaWikiServices.php.

◆ getLockManagerGroupFactory()

MediaWiki\MediaWikiServices::getLockManagerGroupFactory ( )
Since
1.34

Definition at line 1383 of file MediaWikiServices.php.

◆ getLogFormatterFactory()

MediaWiki\MediaWikiServices::getLogFormatterFactory ( )
Since
1.42

Definition at line 1390 of file MediaWikiServices.php.

◆ getMagicWordFactory()

MediaWiki\MediaWikiServices::getMagicWordFactory ( )
Since
1.32

Definition at line 1397 of file MediaWikiServices.php.

◆ getMainConfig()

MediaWiki\MediaWikiServices::getMainConfig ( )

Returns the Config object that provides configuration for MediaWiki core.

This may or may not be the same object that is returned by getBootstrapConfig().

Since
1.27

Definition at line 1407 of file MediaWikiServices.php.

Referenced by MediaWiki\EditPage\EditPage\getCopyrightWarning().

◆ getMainObjectStash()

MediaWiki\MediaWikiServices::getMainObjectStash ( )

Returns the main object stash, yielding EmptyBagOStuff if there is none.

The stash should be shared among all datacenters

Since
1.28

Definition at line 1418 of file MediaWikiServices.php.

◆ getMainWANObjectCache()

MediaWiki\MediaWikiServices::getMainWANObjectCache ( )

Returns the main WAN cache, yielding EmptyBagOStuff if there is none.

The cache should relay any purge operations to all datacenters

Since
1.28

Definition at line 1429 of file MediaWikiServices.php.

◆ getMediaHandlerFactory()

MediaWiki\MediaWikiServices::getMediaHandlerFactory ( )
Since
1.28

Definition at line 1436 of file MediaWikiServices.php.

◆ getMergeHistoryFactory()

MediaWiki\MediaWikiServices::getMergeHistoryFactory ( )
Since
1.35

Definition at line 1443 of file MediaWikiServices.php.

◆ getMessageCache()

MediaWiki\MediaWikiServices::getMessageCache ( )
Since
1.34

Definition at line 1450 of file MediaWikiServices.php.

◆ getMessageFormatterFactory()

MediaWiki\MediaWikiServices::getMessageFormatterFactory ( )
Since
1.34

Definition at line 1457 of file MediaWikiServices.php.

◆ getMicroStash()

MediaWiki\MediaWikiServices::getMicroStash ( )
Since
1.42
Stability: unstable
Returns
BagOStuff

Definition at line 1466 of file MediaWikiServices.php.

◆ getMimeAnalyzer()

MediaWiki\MediaWikiServices::getMimeAnalyzer ( )
Since
1.28

Definition at line 1473 of file MediaWikiServices.php.

◆ getMovePageFactory()

MediaWiki\MediaWikiServices::getMovePageFactory ( )
Since
1.34

Definition at line 1480 of file MediaWikiServices.php.

◆ getNamespaceInfo()

MediaWiki\MediaWikiServices::getNamespaceInfo ( )
Since
1.34

Definition at line 1487 of file MediaWikiServices.php.

◆ getNameTableStoreFactory()

MediaWiki\MediaWikiServices::getNameTableStoreFactory ( )
Since
1.32

Definition at line 1494 of file MediaWikiServices.php.

◆ getObjectCacheFactory()

MediaWiki\MediaWikiServices::getObjectCacheFactory ( )
Since
1.42
Returns
ObjectCacheFactory

Definition at line 1502 of file MediaWikiServices.php.

◆ getObjectFactory()

MediaWiki\MediaWikiServices::getObjectFactory ( )

ObjectFactory is intended for instantiating "handlers" from declarative definitions, such as Action API modules, special pages, or REST API handlers.

Since
1.34

Definition at line 1512 of file MediaWikiServices.php.

◆ getOldRevisionImporter()

MediaWiki\MediaWikiServices::getOldRevisionImporter ( )
Since
1.32

Definition at line 1519 of file MediaWikiServices.php.

◆ getPageEditStash()

MediaWiki\MediaWikiServices::getPageEditStash ( )
Since
1.34

Definition at line 1526 of file MediaWikiServices.php.

◆ getPageProps()

MediaWiki\MediaWikiServices::getPageProps ( )
Since
1.36

Definition at line 1533 of file MediaWikiServices.php.

◆ getPageRestHelperFactory()

MediaWiki\MediaWikiServices::getPageRestHelperFactory ( )
Since
1.40

Definition at line 1540 of file MediaWikiServices.php.

◆ getPageStore()

MediaWiki\MediaWikiServices::getPageStore ( )
Since
1.36

Definition at line 1547 of file MediaWikiServices.php.

◆ getPageStoreFactory()

MediaWiki\MediaWikiServices::getPageStoreFactory ( )
Since
1.36

Definition at line 1554 of file MediaWikiServices.php.

◆ getPageUpdaterFactory()

MediaWiki\MediaWikiServices::getPageUpdaterFactory ( )
Since
1.37

Definition at line 1561 of file MediaWikiServices.php.

◆ getParser()

MediaWiki\MediaWikiServices::getParser ( )

Get the main Parser instance.

This is unsafe when the caller is not in a top-level context, because re-entering the parser will throw an exception.

Note
Do not use this service for dependency injection or in service wiring. It is convenience function to get the global instance in global code. For dependency injection or service wiring code use the parser factory via the 'ParserFactory' service and call one of the factory functions, preferably ParserFactory::create.
Since
1.29

Definition at line 1578 of file MediaWikiServices.php.

◆ getParserCache()

MediaWiki\MediaWikiServices::getParserCache ( )
Since
1.30

Definition at line 1585 of file MediaWikiServices.php.

◆ getParserCacheFactory()

MediaWiki\MediaWikiServices::getParserCacheFactory ( )
Since
1.36

Definition at line 1592 of file MediaWikiServices.php.

◆ getParserFactory()

MediaWiki\MediaWikiServices::getParserFactory ( )
Since
1.32

Definition at line 1599 of file MediaWikiServices.php.

◆ getParserOutputAccess()

MediaWiki\MediaWikiServices::getParserOutputAccess ( )
Since
1.36

Definition at line 1606 of file MediaWikiServices.php.

◆ getParsoidDataAccess()

MediaWiki\MediaWikiServices::getParsoidDataAccess ( )
Since
1.39
Access: internal

Definition at line 1614 of file MediaWikiServices.php.

◆ getParsoidOutputStash()

MediaWiki\MediaWikiServices::getParsoidOutputStash ( )
Since
1.39
Stability: unstable
since 1.39, should be stable before release of 1.39

Definition at line 1622 of file MediaWikiServices.php.

◆ getParsoidPageConfigFactory()

MediaWiki\MediaWikiServices::getParsoidPageConfigFactory ( )
Since
1.39
Access: internal

Definition at line 1630 of file MediaWikiServices.php.

◆ getParsoidParserFactory()

MediaWiki\MediaWikiServices::getParsoidParserFactory ( )
Since
1.41
Access: internal

Definition at line 1638 of file MediaWikiServices.php.

◆ getParsoidSiteConfig()

MediaWiki\MediaWikiServices::getParsoidSiteConfig ( )
Since
1.39
Access: internal

Definition at line 1646 of file MediaWikiServices.php.

◆ getPasswordFactory()

MediaWiki\MediaWikiServices::getPasswordFactory ( )
Since
1.32

Definition at line 1653 of file MediaWikiServices.php.

◆ getPasswordReset()

MediaWiki\MediaWikiServices::getPasswordReset ( )
Since
1.34

Definition at line 1660 of file MediaWikiServices.php.

◆ getPerDbNameStatsdDataFactory()

MediaWiki\MediaWikiServices::getPerDbNameStatsdDataFactory ( )
Since
1.32

Definition at line 1667 of file MediaWikiServices.php.

◆ getPermissionManager()

MediaWiki\MediaWikiServices::getPermissionManager ( )
Since
1.33

Definition at line 1674 of file MediaWikiServices.php.

◆ getPingback()

MediaWiki\MediaWikiServices::getPingback ( )
Since
1.41
Access: internal

Definition at line 1682 of file MediaWikiServices.php.

◆ getPoolCounterFactory()

MediaWiki\MediaWikiServices::getPoolCounterFactory ( )
Since
1.40

Definition at line 1689 of file MediaWikiServices.php.

◆ getPreferencesFactory()

MediaWiki\MediaWikiServices::getPreferencesFactory ( )
Since
1.31

Definition at line 1696 of file MediaWikiServices.php.

◆ getPreloadedContentBuilder()

MediaWiki\MediaWikiServices::getPreloadedContentBuilder ( )
Since
1.41

Definition at line 1703 of file MediaWikiServices.php.

◆ getProxyLookup()

MediaWiki\MediaWikiServices::getProxyLookup ( )
Since
1.28

Definition at line 1710 of file MediaWikiServices.php.

◆ getRateLimiter()

MediaWiki\MediaWikiServices::getRateLimiter ( )
Since
1.39

Definition at line 1717 of file MediaWikiServices.php.

◆ getReadOnlyMode()

MediaWiki\MediaWikiServices::getReadOnlyMode ( )
Since
1.29

Definition at line 1724 of file MediaWikiServices.php.

◆ getRedirectLookup()

MediaWiki\MediaWikiServices::getRedirectLookup ( )
Since
1.38

Definition at line 1731 of file MediaWikiServices.php.

◆ getRedirectStore()

MediaWiki\MediaWikiServices::getRedirectStore ( )
Since
1.38

Definition at line 1738 of file MediaWikiServices.php.

◆ getRepoGroup()

MediaWiki\MediaWikiServices::getRepoGroup ( )
Since
1.34

Definition at line 1745 of file MediaWikiServices.php.

◆ getResourceLoader()

MediaWiki\MediaWikiServices::getResourceLoader ( )
Since
1.33

Definition at line 1752 of file MediaWikiServices.php.

◆ getRestrictionStore()

MediaWiki\MediaWikiServices::getRestrictionStore ( )
Since
1.37

Definition at line 1759 of file MediaWikiServices.php.

◆ getRevertedTagUpdateManager()

MediaWiki\MediaWikiServices::getRevertedTagUpdateManager ( )
Since
1.36

Definition at line 1766 of file MediaWikiServices.php.

◆ getRevisionFactory()

MediaWiki\MediaWikiServices::getRevisionFactory ( )
Since
1.31

Definition at line 1773 of file MediaWikiServices.php.

◆ getRevisionLookup()

MediaWiki\MediaWikiServices::getRevisionLookup ( )
Since
1.31

Definition at line 1780 of file MediaWikiServices.php.

◆ getRevisionRenderer()

MediaWiki\MediaWikiServices::getRevisionRenderer ( )
Since
1.32

Definition at line 1787 of file MediaWikiServices.php.

◆ getRevisionStore()

MediaWiki\MediaWikiServices::getRevisionStore ( )
Since
1.31

Definition at line 1794 of file MediaWikiServices.php.

◆ getRevisionStoreFactory()

MediaWiki\MediaWikiServices::getRevisionStoreFactory ( )
Since
1.32

Definition at line 1801 of file MediaWikiServices.php.

◆ getRollbackPageFactory()

MediaWiki\MediaWikiServices::getRollbackPageFactory ( )
Since
1.37

Definition at line 1808 of file MediaWikiServices.php.

◆ getRowCommentFormatter()

MediaWiki\MediaWikiServices::getRowCommentFormatter ( )
Since
1.38

Definition at line 1815 of file MediaWikiServices.php.

◆ getSearchEngineConfig()

MediaWiki\MediaWikiServices::getSearchEngineConfig ( )
Since
1.27

Definition at line 1830 of file MediaWikiServices.php.

◆ getSearchEngineFactory()

MediaWiki\MediaWikiServices::getSearchEngineFactory ( )
Since
1.27

Definition at line 1837 of file MediaWikiServices.php.

◆ getSearchResultThumbnailProvider()

MediaWiki\MediaWikiServices::getSearchResultThumbnailProvider ( )
Since
1.40

Definition at line 1844 of file MediaWikiServices.php.

◆ getService()

MediaWiki\MediaWikiServices::getService ( $name)

Definition at line 351 of file MediaWikiServices.php.

References wfDeprecatedMsg().

◆ getShellboxClientFactory()

MediaWiki\MediaWikiServices::getShellboxClientFactory ( )
Since
1.36

Definition at line 1851 of file MediaWikiServices.php.

◆ getShellCommandFactory()

MediaWiki\MediaWikiServices::getShellCommandFactory ( )
Since
1.30

Definition at line 1858 of file MediaWikiServices.php.

◆ getSignatureValidatorFactory()

MediaWiki\MediaWikiServices::getSignatureValidatorFactory ( )
Since
1.38

Definition at line 1865 of file MediaWikiServices.php.

◆ getSiteLookup()

MediaWiki\MediaWikiServices::getSiteLookup ( )
Since
1.27

Definition at line 1872 of file MediaWikiServices.php.

◆ getSiteStore()

MediaWiki\MediaWikiServices::getSiteStore ( )
Since
1.27

Definition at line 1879 of file MediaWikiServices.php.

◆ getSkinFactory()

MediaWiki\MediaWikiServices::getSkinFactory ( )
Since
1.27

Definition at line 1886 of file MediaWikiServices.php.

◆ getSlotRoleRegistry()

MediaWiki\MediaWikiServices::getSlotRoleRegistry ( )
Since
1.33

Definition at line 1893 of file MediaWikiServices.php.

◆ getSlotRoleStore()

MediaWiki\MediaWikiServices::getSlotRoleStore ( )
Since
1.31

Definition at line 1900 of file MediaWikiServices.php.

◆ getSpamChecker()

MediaWiki\MediaWikiServices::getSpamChecker ( )
Since
1.35

Definition at line 1907 of file MediaWikiServices.php.

◆ getSpecialPageFactory()

MediaWiki\MediaWikiServices::getSpecialPageFactory ( )
Since
1.32

Definition at line 1914 of file MediaWikiServices.php.

◆ getStatsdDataFactory()

MediaWiki\MediaWikiServices::getStatsdDataFactory ( )
Since
1.27

Definition at line 1921 of file MediaWikiServices.php.

◆ getStatsFactory()

MediaWiki\MediaWikiServices::getStatsFactory ( )
Since
1.41

Definition at line 1928 of file MediaWikiServices.php.

◆ getTalkPageNotificationManager()

MediaWiki\MediaWikiServices::getTalkPageNotificationManager ( )
Since
1.35

Definition at line 1935 of file MediaWikiServices.php.

◆ getTempFSFileFactory()

MediaWiki\MediaWikiServices::getTempFSFileFactory ( )
Since
1.34

Definition at line 1942 of file MediaWikiServices.php.

◆ getTempUserConfig()

MediaWiki\MediaWikiServices::getTempUserConfig ( )
Since
1.39

Definition at line 1949 of file MediaWikiServices.php.

◆ getTempUserCreator()

MediaWiki\MediaWikiServices::getTempUserCreator ( )
Since
1.39

Definition at line 1956 of file MediaWikiServices.php.

◆ getTidy()

MediaWiki\MediaWikiServices::getTidy ( )
Since
1.36

Definition at line 1963 of file MediaWikiServices.php.

◆ getTitleFactory()

MediaWiki\MediaWikiServices::getTitleFactory ( )
Since
1.35

Definition at line 1970 of file MediaWikiServices.php.

◆ getTitleFormatter()

MediaWiki\MediaWikiServices::getTitleFormatter ( )
Since
1.28

Definition at line 1977 of file MediaWikiServices.php.

◆ getTitleMatcher()

MediaWiki\MediaWikiServices::getTitleMatcher ( )
Since
1.40

Definition at line 1984 of file MediaWikiServices.php.

◆ getTitleParser()

MediaWiki\MediaWikiServices::getTitleParser ( )
Since
1.28

Definition at line 1991 of file MediaWikiServices.php.

◆ getTracer()

MediaWiki\MediaWikiServices::getTracer ( )

Definition at line 1995 of file MediaWikiServices.php.

◆ getTrackingCategories()

MediaWiki\MediaWikiServices::getTrackingCategories ( )
Since
1.38

Definition at line 2002 of file MediaWikiServices.php.

◆ getUnblockUserFactory()

MediaWiki\MediaWikiServices::getUnblockUserFactory ( )
Since
1.36

Definition at line 2009 of file MediaWikiServices.php.

◆ getUndeletePageFactory()

MediaWiki\MediaWikiServices::getUndeletePageFactory ( )
Since
1.38

Definition at line 2016 of file MediaWikiServices.php.

◆ getUploadRevisionImporter()

MediaWiki\MediaWikiServices::getUploadRevisionImporter ( )
Since
1.32

Definition at line 2023 of file MediaWikiServices.php.

◆ getUrlUtils()

MediaWiki\MediaWikiServices::getUrlUtils ( )
Since
1.39

Definition at line 2030 of file MediaWikiServices.php.

◆ getUserCache()

MediaWiki\MediaWikiServices::getUserCache ( )
Since
1.36
Deprecated
since 1.43, use ActorStore

Definition at line 2038 of file MediaWikiServices.php.

◆ getUserEditTracker()

MediaWiki\MediaWikiServices::getUserEditTracker ( )
Since
1.35

Definition at line 2045 of file MediaWikiServices.php.

◆ getUserFactory()

MediaWiki\MediaWikiServices::getUserFactory ( )
Since
1.35

Definition at line 2052 of file MediaWikiServices.php.

◆ getUserGroupManager()

MediaWiki\MediaWikiServices::getUserGroupManager ( )
Since
1.35

Definition at line 2059 of file MediaWikiServices.php.

◆ getUserGroupManagerFactory()

MediaWiki\MediaWikiServices::getUserGroupManagerFactory ( )
Since
1.35

Definition at line 2066 of file MediaWikiServices.php.

◆ getUserIdentityLookup()

MediaWiki\MediaWikiServices::getUserIdentityLookup ( )
Since
1.36

Definition at line 2073 of file MediaWikiServices.php.

◆ getUserIdentityUtils()

MediaWiki\MediaWikiServices::getUserIdentityUtils ( )
Since
1.41

Definition at line 2080 of file MediaWikiServices.php.

◆ getUserNamePrefixSearch()

MediaWiki\MediaWikiServices::getUserNamePrefixSearch ( )
Since
1.36

Definition at line 2087 of file MediaWikiServices.php.

◆ getUserNameUtils()

MediaWiki\MediaWikiServices::getUserNameUtils ( )
Since
1.35

Definition at line 2094 of file MediaWikiServices.php.

◆ getUserOptionsLookup()

MediaWiki\MediaWikiServices::getUserOptionsLookup ( )
Since
1.35

Definition at line 2101 of file MediaWikiServices.php.

◆ getUserOptionsManager()

MediaWiki\MediaWikiServices::getUserOptionsManager ( )
Since
1.35

Definition at line 2108 of file MediaWikiServices.php.

◆ getUserRegistrationLookup()

MediaWiki\MediaWikiServices::getUserRegistrationLookup ( )
Since
1.41

Definition at line 2115 of file MediaWikiServices.php.

◆ getWatchedItemQueryService()

MediaWiki\MediaWikiServices::getWatchedItemQueryService ( )
Since
1.28

Definition at line 2122 of file MediaWikiServices.php.

◆ getWatchedItemStore()

MediaWiki\MediaWikiServices::getWatchedItemStore ( )
Since
1.28

Definition at line 2129 of file MediaWikiServices.php.

◆ getWatchlistManager()

MediaWiki\MediaWikiServices::getWatchlistManager ( )
Since
1.36

Definition at line 2136 of file MediaWikiServices.php.

◆ getWikiExporterFactory()

MediaWiki\MediaWikiServices::getWikiExporterFactory ( )
Since
1.38

Definition at line 2143 of file MediaWikiServices.php.

◆ getWikiImporterFactory()

MediaWiki\MediaWikiServices::getWikiImporterFactory ( )
Since
1.37

Definition at line 2150 of file MediaWikiServices.php.

◆ getWikiPageFactory()

MediaWiki\MediaWikiServices::getWikiPageFactory ( )
Since
1.36

Definition at line 2157 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporter()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporter ( )
Since
1.31

Definition at line 2164 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporterNoUpdates()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporterNoUpdates ( )
Since
1.31

Definition at line 2171 of file MediaWikiServices.php.

◆ getWikiRevisionUploadImporter()

MediaWiki\MediaWikiServices::getWikiRevisionUploadImporter ( )
Since
1.31

Definition at line 2178 of file MediaWikiServices.php.

◆ getWRStatsFactory()

MediaWiki\MediaWikiServices::getWRStatsFactory ( )
Since
1.39

Definition at line 2185 of file MediaWikiServices.php.

◆ hasInstance()

static MediaWiki\MediaWikiServices::hasInstance ( )
static

Returns true if an instance has already been initialized.

This can be used to avoid accessing services if it's not safe, such as in unit tests or early setup.

Definition at line 307 of file MediaWikiServices.php.

Referenced by MediaWiki\Html\TemplateParser\getTemplate().

◆ isStorageDisabled()

MediaWiki\MediaWikiServices::isStorageDisabled ( )

Returns true if disableStorage() has been called on this MediaWikiServices instance.

Definition at line 589 of file MediaWikiServices.php.

◆ newSearchEngine()

MediaWiki\MediaWikiServices::newSearchEngine ( )
Since
1.27

Definition at line 1822 of file MediaWikiServices.php.

◆ resetChildProcessServices()

static MediaWiki\MediaWikiServices::resetChildProcessServices ( )
static

Resets any services that may have become stale after a child processö returns from after pcntl_fork().

It's also safe, but generally unnecessary, to call this method from the parent process.

Since
1.28
Note
This is intended for use in the context of process forking only!
See also
resetGlobalInstance()
disableStorage()

Definition at line 605 of file MediaWikiServices.php.

Referenced by MediaWiki\Maintenance\ForkController\prepareEnvironment().

◆ resetGlobalInstance()

static MediaWiki\MediaWikiServices::resetGlobalInstance ( ?Config $bootstrapConfig = null,
$mode = 'reset' )
static

Creates a new instance of MediaWikiServices and sets it as the global default instance.

getInstance() will return a different MediaWikiServices object after every call to resetGlobalInstance().

Since
1.28
Warning
This should not be used during normal operation. It is intended for use when the configuration has changed significantly since bootstrap time, e.g. during the installation process or during testing. The method must not be called after MW_SERVICE_BOOTSTRAP_COMPLETE has been defined in Setup.php, unless MW_PHPUNIT_TEST or MEDIAWIKI_INSTALL or RUN_MAINTENANCE_IF_MAIN is defined).
Calling resetGlobalInstance() may leave the application in an inconsistent state. Calling this is only safe under the ASSUMPTION that NO REFERENCE to any of the services managed by MediaWikiServices exist. If any service objects managed by the old MediaWikiServices instance remain in use, they may INTERFERE with the operation of the services managed by the new MediaWikiServices. Operating with a mix of services created by the old and the new MediaWikiServices instance may lead to INCONSISTENCIES and even DATA LOSS! Any class implementing LAZY LOADING is especially prone to this problem, since instances would typically retain a reference to a storage layer service.
See also
forceGlobalInstance()
resetGlobalInstance()
resetBetweenTest()
Parameters
Config | null$bootstrapConfigThe Config object to be registered as the 'BootstrapConfig' service. This has to contain at least the information needed to set up the 'ConfigFactory' service. If not given, the bootstrap config of the old instance of MediaWikiServices will be re-used. If there was no previous instance, a new GlobalVarConfig object will be used to bootstrap the services.
string$modeMay be one of:
  • quick: allow expensive resources to be re-used. See SalvageableService for details.
  • reset: discard expensive resources but reuse service wiring (default)
  • reload: discard expensive resources and reload the service wiring

Definition at line 420 of file MediaWikiServices.php.

References $runner.

Referenced by MediaWiki\Installer\Installer\disableStorage().

◆ resetServiceForTesting()

MediaWiki\MediaWikiServices::resetServiceForTesting ( $name,
$destroy = true )

Resets the given service for testing purposes.

Since
1.28
Warning
This is generally unsafe! Other services may still retain references to the stale service instance, leading to failures and inconsistencies. Subclasses may use this method to reset specific services under specific instances, but it should not be exposed to application logic.
Note
With proper dependency injection used throughout the codebase, this method should not be needed. It is provided to allow tests that pollute global service instances to clean up.
Parameters
string$name
bool$destroyWhether the service instance should be destroyed if it exists. When set to false, any existing service instance will effectively be detached from the container.

Definition at line 634 of file MediaWikiServices.php.


The documentation for this class was generated from the following file: