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 ()
 
 getContentModelChangeFactory ()
 
 getContentModelStore ()
 
 getContentRenderer ()
 
 getContentTransformer ()
 
 getCriticalSectionProvider ()
 
 getCryptHKDF ()
 
 getDatabaseBlockStore ()
 
 getDatabaseBlockStoreFactory ()
 
 getDatabaseFactory ()
 
 getDateFormatterFactory ()
 
 getDBLoadBalancer ()
 
 getDBLoadBalancerFactory ()
 
 getDBLoadBalancerFactoryConfigBuilder ()
 
 getDefaultOutputPipeline ()
 
 getDeletePageFactory ()
 
 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 ()
 
 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 ()
 
 getParsoidOutputAccess ()
 
 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 ()
 
 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, $quick='')
 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 239 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 676 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 269 of file MediaWikiServices.php.

◆ allowGlobalInstanceAfterUnitTests()

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

Definition at line 293 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() 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 524 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 504 of file MediaWikiServices.php.

◆ disallowGlobalInstanceInUnitTests()

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

Definition at line 283 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 660 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 368 of file MediaWikiServices.php.

◆ getActionFactory()

MediaWiki\MediaWikiServices::getActionFactory ( )
Since
1.37

Definition at line 690 of file MediaWikiServices.php.

◆ getActorMigration()

MediaWiki\MediaWikiServices::getActorMigration ( )
Since
1.31

Definition at line 697 of file MediaWikiServices.php.

◆ getActorNormalization()

MediaWiki\MediaWikiServices::getActorNormalization ( )
Since
1.36

Definition at line 704 of file MediaWikiServices.php.

◆ getActorStore()

MediaWiki\MediaWikiServices::getActorStore ( )
Since
1.36

Definition at line 711 of file MediaWikiServices.php.

◆ getActorStoreFactory()

MediaWiki\MediaWikiServices::getActorStoreFactory ( )
Since
1.36

Definition at line 718 of file MediaWikiServices.php.

◆ getArchivedRevisionLookup()

MediaWiki\MediaWikiServices::getArchivedRevisionLookup ( )
Since
1.38

Definition at line 725 of file MediaWikiServices.php.

◆ getAuthManager()

MediaWiki\MediaWikiServices::getAuthManager ( )
Since
1.35

Definition at line 732 of file MediaWikiServices.php.

◆ getAutoblockExemptionList()

MediaWiki\MediaWikiServices::getAutoblockExemptionList ( )
Since
1.42

Definition at line 739 of file MediaWikiServices.php.

◆ getBacklinkCacheFactory()

MediaWiki\MediaWikiServices::getBacklinkCacheFactory ( )
Since
1.37

Definition at line 746 of file MediaWikiServices.php.

◆ getBadFileLookup()

MediaWiki\MediaWikiServices::getBadFileLookup ( )
Since
1.34

Definition at line 753 of file MediaWikiServices.php.

◆ getBlobStore()

MediaWiki\MediaWikiServices::getBlobStore ( )
Since
1.31

Definition at line 760 of file MediaWikiServices.php.

◆ getBlobStoreFactory()

MediaWiki\MediaWikiServices::getBlobStoreFactory ( )
Since
1.31

Definition at line 767 of file MediaWikiServices.php.

◆ getBlockActionInfo()

MediaWiki\MediaWikiServices::getBlockActionInfo ( )
Since
1.37

Definition at line 774 of file MediaWikiServices.php.

◆ getBlockErrorFormatter()

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

Definition at line 782 of file MediaWikiServices.php.

◆ getBlockManager()

MediaWiki\MediaWikiServices::getBlockManager ( )
Since
1.34

Definition at line 790 of file MediaWikiServices.php.

◆ getBlockPermissionCheckerFactory()

MediaWiki\MediaWikiServices::getBlockPermissionCheckerFactory ( )
Since
1.35

Definition at line 797 of file MediaWikiServices.php.

◆ getBlockRestrictionStore()

MediaWiki\MediaWikiServices::getBlockRestrictionStore ( )
Since
1.33

Definition at line 804 of file MediaWikiServices.php.

◆ getBlockRestrictionStoreFactory()

MediaWiki\MediaWikiServices::getBlockRestrictionStoreFactory ( )
Since
1.38

Definition at line 811 of file MediaWikiServices.php.

◆ getBlockUserFactory()

MediaWiki\MediaWikiServices::getBlockUserFactory ( )
Since
1.36

Definition at line 818 of file MediaWikiServices.php.

◆ getBlockUtils()

MediaWiki\MediaWikiServices::getBlockUtils ( )
Since
1.36

Definition at line 825 of file MediaWikiServices.php.

◆ getBlockUtilsFactory()

MediaWiki\MediaWikiServices::getBlockUtilsFactory ( )
Since
1.42

Definition at line 832 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 848 of file MediaWikiServices.php.

◆ getBotPasswordStore()

MediaWiki\MediaWikiServices::getBotPasswordStore ( )
Since
1.37

Definition at line 855 of file MediaWikiServices.php.

◆ getCentralIdLookup()

MediaWiki\MediaWikiServices::getCentralIdLookup ( )
Since
1.37

Definition at line 862 of file MediaWikiServices.php.

◆ getCentralIdLookupFactory()

MediaWiki\MediaWikiServices::getCentralIdLookupFactory ( )
Since
1.37

Definition at line 869 of file MediaWikiServices.php.

◆ getChangeTagDefStore()

MediaWiki\MediaWikiServices::getChangeTagDefStore ( )
Since
1.32

Definition at line 876 of file MediaWikiServices.php.

◆ getChangeTagsStore()

MediaWiki\MediaWikiServices::getChangeTagsStore ( )
Since
1.41

Definition at line 883 of file MediaWikiServices.php.

◆ getChronologyProtector()

MediaWiki\MediaWikiServices::getChronologyProtector ( )
Since
1.41

Definition at line 890 of file MediaWikiServices.php.

◆ getCollationFactory()

MediaWiki\MediaWikiServices::getCollationFactory ( )
Since
1.37

Definition at line 897 of file MediaWikiServices.php.

◆ getCommentFormatter()

MediaWiki\MediaWikiServices::getCommentFormatter ( )
Since
1.38

Definition at line 904 of file MediaWikiServices.php.

◆ getCommentParserFactory()

MediaWiki\MediaWikiServices::getCommentParserFactory ( )
Since
1.41

Definition at line 911 of file MediaWikiServices.php.

◆ getCommentStore()

MediaWiki\MediaWikiServices::getCommentStore ( )
Since
1.31

Definition at line 918 of file MediaWikiServices.php.

◆ getConfigFactory()

MediaWiki\MediaWikiServices::getConfigFactory ( )
Since
1.27

Definition at line 925 of file MediaWikiServices.php.

◆ getConfigRepository()

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

Definition at line 933 of file MediaWikiServices.php.

◆ getConfigSchema()

MediaWiki\MediaWikiServices::getConfigSchema ( )
Since
1.39

Definition at line 941 of file MediaWikiServices.php.

◆ getConfiguredReadOnlyMode()

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

Definition at line 949 of file MediaWikiServices.php.

◆ getConnectionProvider()

MediaWiki\MediaWikiServices::getConnectionProvider ( )
Since
1.42

Definition at line 956 of file MediaWikiServices.php.

◆ getContentHandlerFactory()

MediaWiki\MediaWikiServices::getContentHandlerFactory ( )
Since
1.35

Definition at line 963 of file MediaWikiServices.php.

◆ getContentLanguage()

MediaWiki\MediaWikiServices::getContentLanguage ( )
Since
1.32

Definition at line 970 of file MediaWikiServices.php.

◆ getContentModelChangeFactory()

MediaWiki\MediaWikiServices::getContentModelChangeFactory ( )
Since
1.35

Definition at line 977 of file MediaWikiServices.php.

◆ getContentModelStore()

MediaWiki\MediaWikiServices::getContentModelStore ( )
Since
1.31

Definition at line 984 of file MediaWikiServices.php.

◆ getContentRenderer()

MediaWiki\MediaWikiServices::getContentRenderer ( )
Since
1.38

Definition at line 991 of file MediaWikiServices.php.

◆ getContentTransformer()

MediaWiki\MediaWikiServices::getContentTransformer ( )
Since
1.37

Definition at line 998 of file MediaWikiServices.php.

◆ getCriticalSectionProvider()

MediaWiki\MediaWikiServices::getCriticalSectionProvider ( )
Since
1.36

Definition at line 1005 of file MediaWikiServices.php.

◆ getCryptHKDF()

MediaWiki\MediaWikiServices::getCryptHKDF ( )
Since
1.28

Definition at line 1012 of file MediaWikiServices.php.

◆ getDatabaseBlockStore()

MediaWiki\MediaWikiServices::getDatabaseBlockStore ( )
Since
1.36

Definition at line 1019 of file MediaWikiServices.php.

◆ getDatabaseBlockStoreFactory()

MediaWiki\MediaWikiServices::getDatabaseBlockStoreFactory ( )
Since
1.40

Definition at line 1026 of file MediaWikiServices.php.

◆ getDatabaseFactory()

MediaWiki\MediaWikiServices::getDatabaseFactory ( )
Since
1.39

Definition at line 1033 of file MediaWikiServices.php.

◆ getDateFormatterFactory()

MediaWiki\MediaWikiServices::getDateFormatterFactory ( )
Since
1.33

Definition at line 1040 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 1048 of file MediaWikiServices.php.

◆ getDBLoadBalancerFactory()

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

Definition at line 1056 of file MediaWikiServices.php.

◆ getDBLoadBalancerFactoryConfigBuilder()

MediaWiki\MediaWikiServices::getDBLoadBalancerFactoryConfigBuilder ( )
Since
1.39

Definition at line 1063 of file MediaWikiServices.php.

◆ getDefaultOutputPipeline()

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

Definition at line 1071 of file MediaWikiServices.php.

◆ getDeletePageFactory()

MediaWiki\MediaWikiServices::getDeletePageFactory ( )
Since
1.37

Definition at line 1078 of file MediaWikiServices.php.

◆ getEmailer()

MediaWiki\MediaWikiServices::getEmailer ( )
Since
1.35

Definition at line 1085 of file MediaWikiServices.php.

◆ getEmailUserFactory()

MediaWiki\MediaWikiServices::getEmailUserFactory ( )
Since
1.41

Definition at line 1092 of file MediaWikiServices.php.

◆ getEventRelayerGroup()

MediaWiki\MediaWikiServices::getEventRelayerGroup ( )
Since
1.27

Definition at line 1099 of file MediaWikiServices.php.

◆ getExtensionRegistry()

MediaWiki\MediaWikiServices::getExtensionRegistry ( )
Since
1.42

Definition at line 1106 of file MediaWikiServices.php.

◆ getExternalStoreAccess()

MediaWiki\MediaWikiServices::getExternalStoreAccess ( )
Since
1.34

Definition at line 1113 of file MediaWikiServices.php.

◆ getExternalStoreFactory()

MediaWiki\MediaWikiServices::getExternalStoreFactory ( )
Since
1.31

Definition at line 1120 of file MediaWikiServices.php.

◆ getFileBackendGroup()

MediaWiki\MediaWikiServices::getFileBackendGroup ( )
Since
1.35

Definition at line 1127 of file MediaWikiServices.php.

◆ getFormatterFactory()

MediaWiki\MediaWikiServices::getFormatterFactory ( )
Since
1.41

Definition at line 1134 of file MediaWikiServices.php.

◆ getGenderCache()

MediaWiki\MediaWikiServices::getGenderCache ( )
Since
1.28

Definition at line 1141 of file MediaWikiServices.php.

◆ getGlobalIdGenerator()

MediaWiki\MediaWikiServices::getGlobalIdGenerator ( )
Since
1.35

Definition at line 1148 of file MediaWikiServices.php.

◆ getGrantsInfo()

MediaWiki\MediaWikiServices::getGrantsInfo ( )
Since
1.38

Definition at line 1155 of file MediaWikiServices.php.

◆ getGrantsLocalization()

MediaWiki\MediaWikiServices::getGrantsLocalization ( )
Since
1.38

Definition at line 1162 of file MediaWikiServices.php.

◆ getGroupPermissionsLookup()

MediaWiki\MediaWikiServices::getGroupPermissionsLookup ( )
Since
1.36

Definition at line 1169 of file MediaWikiServices.php.

◆ getHideUserUtils()

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

Definition at line 1177 of file MediaWikiServices.php.

◆ getHookContainer()

MediaWiki\MediaWikiServices::getHookContainer ( )
Since
1.35

Definition at line 1184 of file MediaWikiServices.php.

◆ getHtmlCacheUpdater()

MediaWiki\MediaWikiServices::getHtmlCacheUpdater ( )
Since
1.35

Definition at line 1191 of file MediaWikiServices.php.

◆ getHtmlTransformFactory()

MediaWiki\MediaWikiServices::getHtmlTransformFactory ( )
Since
1.39

Definition at line 1198 of file MediaWikiServices.php.

◆ getHttpRequestFactory()

MediaWiki\MediaWikiServices::getHttpRequestFactory ( )
Since
1.31

Definition at line 1205 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 322 of file MediaWikiServices.php.

References wfDeprecatedMsg().

Referenced by 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\ResourceLoader\ForeignResourceManager\__construct(), MediaWiki\Utils\GitInfo\__construct(), MediaWiki\Installer\CliInstaller\__construct(), MediaWiki\Html\TemplateParser\__construct(), MediaWiki\Cache\FileCacheBase\__construct(), MediaWiki\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\EditPage\EditPage\__construct(), MediaWiki\Page\ProtectionForm\__construct(), MediaWiki\Actions\FileDeleteAction\__construct(), MediaWiki\ResourceLoader\ResourceLoader\__construct(), MediaWiki\Pager\HistoryPager\__construct(), MediaWiki\Specials\SpecialAllPages\__construct(), MediaWiki\Pager\ContribsPager\__construct(), MediaWiki\Pager\IndexPager\__construct(), MediaWiki\Specials\SpecialContributions\__construct(), MediaWiki\Cache\GenderCache\__construct(), MediaWiki\Category\CategoryViewer\__construct(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\__construct(), MediaWiki\Specials\SpecialPreferences\__construct(), MediaWiki\Specials\SpecialUpload\__construct(), MediaWiki\ResourceLoader\Context\__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\Specials\SpecialUserRights\__construct(), MediaWiki\Specials\SpecialRecentChanges\__construct(), MediaWiki\Specials\SpecialEditWatchlist\__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\SpecialBlock\canBlockEmail(), MediaWiki\Specials\SpecialPageLanguage\changePageLanguage(), MediaWiki\User\User\checkAndSetTouched(), MediaWiki\Feed\FeedUtils\checkFeedOutput(), MediaWiki\Preferences\SignatureValidator\checkLintErrors(), MediaWiki\User\User\checkPasswordValidity(), MediaWiki\SpecialPage\SpecialPage\checkReadOnly(), MediaWiki\Specials\SpecialWatchlist\checkStructuredFilterUiEnabled(), MediaWiki\User\User\clearInstanceCache(), MediaWiki\SpecialPage\ChangesListSpecialPage\considerActionsForDefaultSavedQuery(), MediaWiki\Output\StreamFile\contentTypeFromPath(), MediaWiki\Block\DatabaseBlock\delete(), MediaWiki\Content\TextContent\diff(), MediaWiki\Installer\Installer\dirIsExecutable(), MediaWiki\Block\DatabaseBlock\doAutoblock(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), MediaWiki\RevisionList\RevisionList\doQuery(), MediaWiki\Deferred\CdnCacheUpdate\doUpdate(), MediaWiki\Deferred\MessageCacheUpdate\doUpdate(), MediaWiki\Deferred\SearchUpdate\doUpdate(), MediaWiki\Deferred\SiteStatsUpdate\doUpdate(), MediaWiki\Deferred\UserEditCountUpdate\doUpdate(), 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\Installer\WebInstallerLanguage\execute(), 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\Feed\FeedUtils\formatDiff(), MediaWiki\Feed\FeedUtils\formatDiffRow(), MediaWiki\Feed\FeedUtils\formatDiffRow2(), MediaWiki\Deferred\LinksUpdate\LinksTableGroup\get(), MediaWiki\Installer\WebInstaller\getAcceptLanguage(), MediaWiki\SpecialPage\SpecialPage\getAuthManager(), MediaWiki\User\User\getCacheKey(), MediaWiki\WikiMap\WikiMap\getCanonicalServerInfoForAllWikis(), MediaWiki\Context\RequestContext\getConfig(), MediaWiki\ResourceLoader\WikiModule\getContent(), MediaWiki\ResourceLoader\WikiModule\getContentObj(), MediaWiki\Request\FauxRequest\getCookie(), MediaWiki\Installer\WebInstallerOutput\getCSS(), MediaWiki\Pager\AllMessagesTablePager\getCustomisedStatuses(), MediaWiki\ResourceLoader\WikiModule\getDB(), MediaWiki\SpecialPage\QueryPage\getDBLoadBalancer(), MediaWiki\Specials\SpecialVersion\getExtensionTypes(), MediaWiki\SpecialPage\LoginSignupSpecialPage\getFieldDefinitions(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\ResourceLoader\Module\getFlip(), MediaWiki\RevisionList\RevisionItem\getHTML(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\Specials\SpecialUpload\getInitialPageText(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), 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\Request\WebRequestUpload\getName(), MediaWiki\SpecialPage\QueryPage\getPages(), MediaWiki\ResourceLoader\UserModule\getPages(), MediaWiki\ResourceLoader\UserStylesModule\getPages(), 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\DeletedContribsPager\getQueryInfo(), MediaWiki\Pager\MergeHistoryPager\getQueryInfo(), MediaWiki\Block\DatabaseBlock\getRangeCond(), MediaWiki\SpecialPage\ChangesListSpecialPage\getRcFiltersConfigSummary(), MediaWiki\SpecialPage\ChangesListSpecialPage\getRcFiltersConfigVars(), MediaWiki\Utils\MWTimestamp\getRelativeTimestamp(), MediaWiki\SpecialPage\SpecialPage\getSafeTitleFor(), MediaWiki\ResourceLoader\UserOptionsModule\getScript(), MediaWiki\Cache\LinkCache\getSelectFields(), MediaWiki\Specials\SpecialBlock\getSuggestedDurations(), MediaWiki\Specials\SpecialEmailUser\getTarget(), MediaWiki\Html\TemplateParser\getTemplate(), MediaWiki\Parser\ParserOutput\getText(), MediaWiki\EditPage\TextboxBuilder\getTextboxProtectionCSSClasses(), MediaWiki\Content\TextContent\getTextForSummary(), MediaWiki\SpecialPage\SpecialPage\getTitleValueFor(), MediaWiki\Linker\Linker\getUploadUrl(), MediaWiki\Session\UserInfo\getUser(), MediaWiki\User\ExternalUserNames\getUserLinkTitle(), MediaWiki\Context\DerivativeContext\getWikiPage(), MediaWiki\Context\RequestContext\getWikiPage(), MediaWiki\Output\OutputHandler\handle(), MediaWiki\LinkedData\PageDataRequestHandler\handleRequest(), MediaWiki\Html\Html\htmlHeader(), MediaWiki\LinkedData\PageDataRequestHandler\httpContentNegotiation(), MediaWiki\Feed\ChannelFeed\httpHeaders(), MediaWiki\Installer\Installer\includeExtensions(), MediaWiki\SpecialPage\ChangesListSpecialPage\includeRcFiltersApp(), MediaWiki\Block\DatabaseBlock\insert(), MediaWiki\Content\TextContent\isCountable(), MediaWiki\Block\DatabaseBlock\isExemptedFromAutoblocks(), MediaWiki\User\User\isPingLimitable(), MediaWiki\SpecialPage\SpecialPage\isRestricted(), MediaWiki\SiteStats\SiteStats\jobs(), 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\SpecialPage\LoginSignupSpecialPage\mainLoginForm(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Linker\Linker\makeExternalImage(), MediaWiki\Linker\Linker\makeExternalLink(), 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\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\SiteStats\SiteStats\pagesInNs(), MediaWiki\Installer\Installer\parse(), MediaWiki\Installer\DatabaseUpdater\patchPath(), MediaWiki\Maintenance\ForkController\prepareEnvironment(), MediaWiki\ExternalLinks\LinkFilter\prepareProtocols(), MediaWiki\Specials\SpecialBlock\processForm(), MediaWiki\Linker\Linker\processResponsiveImages(), 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\Search\SearchWidgets\BasicSearchResultSetWidget\render(), MediaWiki\Installer\Installer\resetMediaWikiServices(), MediaWiki\ExternalLinks\LinkFilter\reverseIndexes(), MediaWiki\Watchlist\WatchlistExpiryJob\run(), MediaWiki\Request\WebResponse\setCookie(), MediaWiki\Request\FauxRequest\setCookies(), MediaWiki\Installer\DatabaseUpdater\setFileAccess(), MediaWiki\Site\Site\setLanguageCode(), MediaWiki\Installer\WebInstaller\setupLanguage(), MediaWiki\Cache\UserCache\singleton(), MediaWiki\Installer\MysqlSettingsForm\submit(), MediaWiki\Installer\WebInstallerName\submit(), MediaWiki\Block\DatabaseBlock\update(), MediaWiki\Deferred\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(), and MediaWiki\HTMLForm\Field\HTMLUserTextField\validate().

◆ getInterwikiLookup()

MediaWiki\MediaWikiServices::getInterwikiLookup ( )
Since
1.28

Definition at line 1212 of file MediaWikiServices.php.

◆ getIntroMessageBuilder()

MediaWiki\MediaWikiServices::getIntroMessageBuilder ( )
Since
1.41

Definition at line 1219 of file MediaWikiServices.php.

◆ getJobFactory()

MediaWiki\MediaWikiServices::getJobFactory ( )
Since
1.40

Definition at line 1226 of file MediaWikiServices.php.

◆ getJobQueueGroup()

MediaWiki\MediaWikiServices::getJobQueueGroup ( )
Since
1.37

Definition at line 1233 of file MediaWikiServices.php.

◆ getJobQueueGroupFactory()

MediaWiki\MediaWikiServices::getJobQueueGroupFactory ( )
Since
1.37

Definition at line 1240 of file MediaWikiServices.php.

◆ getJobRunner()

MediaWiki\MediaWikiServices::getJobRunner ( )
Since
1.35

Definition at line 1247 of file MediaWikiServices.php.

◆ getJsonCodec()

MediaWiki\MediaWikiServices::getJsonCodec ( )
Since
1.36

Definition at line 1254 of file MediaWikiServices.php.

◆ getLanguageConverterFactory()

MediaWiki\MediaWikiServices::getLanguageConverterFactory ( )
Since
1.35

Definition at line 1261 of file MediaWikiServices.php.

◆ getLanguageFactory()

MediaWiki\MediaWikiServices::getLanguageFactory ( )
Since
1.35

Definition at line 1268 of file MediaWikiServices.php.

◆ getLanguageFallback()

MediaWiki\MediaWikiServices::getLanguageFallback ( )
Since
1.35

Definition at line 1275 of file MediaWikiServices.php.

◆ getLanguageNameUtils()

MediaWiki\MediaWikiServices::getLanguageNameUtils ( )
Since
1.34

Definition at line 1282 of file MediaWikiServices.php.

◆ getLinkBatchFactory()

MediaWiki\MediaWikiServices::getLinkBatchFactory ( )
Since
1.35

Definition at line 1289 of file MediaWikiServices.php.

◆ getLinkCache()

MediaWiki\MediaWikiServices::getLinkCache ( )
Since
1.28

Definition at line 1296 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 1306 of file MediaWikiServices.php.

◆ getLinkRendererFactory()

MediaWiki\MediaWikiServices::getLinkRendererFactory ( )
Since
1.28

Definition at line 1313 of file MediaWikiServices.php.

◆ getLinksMigration()

MediaWiki\MediaWikiServices::getLinksMigration ( )
Since
1.39

Definition at line 1320 of file MediaWikiServices.php.

◆ getLinkTargetLookup()

MediaWiki\MediaWikiServices::getLinkTargetLookup ( )
Since
1.38

Definition at line 1327 of file MediaWikiServices.php.

◆ getLocalisationCache()

MediaWiki\MediaWikiServices::getLocalisationCache ( )
Since
1.34

Definition at line 1334 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 1346 of file MediaWikiServices.php.

◆ getLockManagerGroupFactory()

MediaWiki\MediaWikiServices::getLockManagerGroupFactory ( )
Since
1.34

Definition at line 1353 of file MediaWikiServices.php.

◆ getLogFormatterFactory()

MediaWiki\MediaWikiServices::getLogFormatterFactory ( )
Since
1.42

Definition at line 1360 of file MediaWikiServices.php.

◆ getMagicWordFactory()

MediaWiki\MediaWikiServices::getMagicWordFactory ( )
Since
1.32

Definition at line 1367 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 1377 of file MediaWikiServices.php.

◆ 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 1388 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 1399 of file MediaWikiServices.php.

◆ getMediaHandlerFactory()

MediaWiki\MediaWikiServices::getMediaHandlerFactory ( )
Since
1.28

Definition at line 1406 of file MediaWikiServices.php.

◆ getMergeHistoryFactory()

MediaWiki\MediaWikiServices::getMergeHistoryFactory ( )
Since
1.35

Definition at line 1413 of file MediaWikiServices.php.

◆ getMessageCache()

MediaWiki\MediaWikiServices::getMessageCache ( )
Since
1.34

Definition at line 1420 of file MediaWikiServices.php.

◆ getMessageFormatterFactory()

MediaWiki\MediaWikiServices::getMessageFormatterFactory ( )
Since
1.34

Definition at line 1427 of file MediaWikiServices.php.

◆ getMicroStash()

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

Definition at line 1436 of file MediaWikiServices.php.

◆ getMimeAnalyzer()

MediaWiki\MediaWikiServices::getMimeAnalyzer ( )
Since
1.28

Definition at line 1443 of file MediaWikiServices.php.

◆ getMovePageFactory()

MediaWiki\MediaWikiServices::getMovePageFactory ( )
Since
1.34

Definition at line 1450 of file MediaWikiServices.php.

◆ getNamespaceInfo()

MediaWiki\MediaWikiServices::getNamespaceInfo ( )
Since
1.34

Definition at line 1457 of file MediaWikiServices.php.

◆ getNameTableStoreFactory()

MediaWiki\MediaWikiServices::getNameTableStoreFactory ( )
Since
1.32

Definition at line 1464 of file MediaWikiServices.php.

◆ getObjectCacheFactory()

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

Definition at line 1472 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 1482 of file MediaWikiServices.php.

◆ getOldRevisionImporter()

MediaWiki\MediaWikiServices::getOldRevisionImporter ( )
Since
1.32

Definition at line 1489 of file MediaWikiServices.php.

◆ getPageEditStash()

MediaWiki\MediaWikiServices::getPageEditStash ( )
Since
1.34

Definition at line 1496 of file MediaWikiServices.php.

◆ getPageProps()

MediaWiki\MediaWikiServices::getPageProps ( )
Since
1.36

Definition at line 1503 of file MediaWikiServices.php.

◆ getPageRestHelperFactory()

MediaWiki\MediaWikiServices::getPageRestHelperFactory ( )
Since
1.40

Definition at line 1510 of file MediaWikiServices.php.

◆ getPageStore()

MediaWiki\MediaWikiServices::getPageStore ( )
Since
1.36

Definition at line 1517 of file MediaWikiServices.php.

◆ getPageStoreFactory()

MediaWiki\MediaWikiServices::getPageStoreFactory ( )
Since
1.36

Definition at line 1524 of file MediaWikiServices.php.

◆ getPageUpdaterFactory()

MediaWiki\MediaWikiServices::getPageUpdaterFactory ( )
Since
1.37

Definition at line 1531 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 1548 of file MediaWikiServices.php.

◆ getParserCache()

MediaWiki\MediaWikiServices::getParserCache ( )
Since
1.30

Definition at line 1555 of file MediaWikiServices.php.

◆ getParserCacheFactory()

MediaWiki\MediaWikiServices::getParserCacheFactory ( )
Since
1.36

Definition at line 1562 of file MediaWikiServices.php.

◆ getParserFactory()

MediaWiki\MediaWikiServices::getParserFactory ( )
Since
1.32

Definition at line 1569 of file MediaWikiServices.php.

◆ getParserOutputAccess()

MediaWiki\MediaWikiServices::getParserOutputAccess ( )
Since
1.36

Definition at line 1576 of file MediaWikiServices.php.

◆ getParsoidDataAccess()

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

Definition at line 1584 of file MediaWikiServices.php.

◆ getParsoidOutputAccess()

MediaWiki\MediaWikiServices::getParsoidOutputAccess ( )
Since
1.39
Stability: unstable

Definition at line 1592 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 1600 of file MediaWikiServices.php.

◆ getParsoidPageConfigFactory()

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

Definition at line 1608 of file MediaWikiServices.php.

◆ getParsoidParserFactory()

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

Definition at line 1616 of file MediaWikiServices.php.

◆ getParsoidSiteConfig()

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

Definition at line 1624 of file MediaWikiServices.php.

◆ getPasswordFactory()

MediaWiki\MediaWikiServices::getPasswordFactory ( )
Since
1.32

Definition at line 1631 of file MediaWikiServices.php.

◆ getPasswordReset()

MediaWiki\MediaWikiServices::getPasswordReset ( )
Since
1.34

Definition at line 1638 of file MediaWikiServices.php.

◆ getPerDbNameStatsdDataFactory()

MediaWiki\MediaWikiServices::getPerDbNameStatsdDataFactory ( )
Since
1.32

Definition at line 1645 of file MediaWikiServices.php.

◆ getPermissionManager()

MediaWiki\MediaWikiServices::getPermissionManager ( )
Since
1.33

Definition at line 1652 of file MediaWikiServices.php.

◆ getPingback()

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

Definition at line 1660 of file MediaWikiServices.php.

◆ getPoolCounterFactory()

MediaWiki\MediaWikiServices::getPoolCounterFactory ( )
Since
1.40

Definition at line 1667 of file MediaWikiServices.php.

◆ getPreferencesFactory()

MediaWiki\MediaWikiServices::getPreferencesFactory ( )
Since
1.31

Definition at line 1674 of file MediaWikiServices.php.

◆ getPreloadedContentBuilder()

MediaWiki\MediaWikiServices::getPreloadedContentBuilder ( )
Since
1.41

Definition at line 1681 of file MediaWikiServices.php.

◆ getProxyLookup()

MediaWiki\MediaWikiServices::getProxyLookup ( )
Since
1.28

Definition at line 1688 of file MediaWikiServices.php.

◆ getRateLimiter()

MediaWiki\MediaWikiServices::getRateLimiter ( )
Since
1.39

Definition at line 1695 of file MediaWikiServices.php.

◆ getReadOnlyMode()

MediaWiki\MediaWikiServices::getReadOnlyMode ( )
Since
1.29

Definition at line 1702 of file MediaWikiServices.php.

◆ getRedirectLookup()

MediaWiki\MediaWikiServices::getRedirectLookup ( )
Since
1.38

Definition at line 1709 of file MediaWikiServices.php.

◆ getRedirectStore()

MediaWiki\MediaWikiServices::getRedirectStore ( )
Since
1.38

Definition at line 1716 of file MediaWikiServices.php.

◆ getRepoGroup()

MediaWiki\MediaWikiServices::getRepoGroup ( )
Since
1.34

Definition at line 1723 of file MediaWikiServices.php.

◆ getResourceLoader()

MediaWiki\MediaWikiServices::getResourceLoader ( )
Since
1.33

Definition at line 1730 of file MediaWikiServices.php.

◆ getRestrictionStore()

MediaWiki\MediaWikiServices::getRestrictionStore ( )
Since
1.37

Definition at line 1737 of file MediaWikiServices.php.

◆ getRevertedTagUpdateManager()

MediaWiki\MediaWikiServices::getRevertedTagUpdateManager ( )
Since
1.36

Definition at line 1744 of file MediaWikiServices.php.

◆ getRevisionFactory()

MediaWiki\MediaWikiServices::getRevisionFactory ( )
Since
1.31

Definition at line 1751 of file MediaWikiServices.php.

◆ getRevisionLookup()

MediaWiki\MediaWikiServices::getRevisionLookup ( )
Since
1.31

Definition at line 1758 of file MediaWikiServices.php.

◆ getRevisionRenderer()

MediaWiki\MediaWikiServices::getRevisionRenderer ( )
Since
1.32

Definition at line 1765 of file MediaWikiServices.php.

◆ getRevisionStore()

MediaWiki\MediaWikiServices::getRevisionStore ( )
Since
1.31

Definition at line 1772 of file MediaWikiServices.php.

◆ getRevisionStoreFactory()

MediaWiki\MediaWikiServices::getRevisionStoreFactory ( )
Since
1.32

Definition at line 1779 of file MediaWikiServices.php.

◆ getRollbackPageFactory()

MediaWiki\MediaWikiServices::getRollbackPageFactory ( )
Since
1.37

Definition at line 1786 of file MediaWikiServices.php.

◆ getRowCommentFormatter()

MediaWiki\MediaWikiServices::getRowCommentFormatter ( )
Since
1.38

Definition at line 1793 of file MediaWikiServices.php.

◆ getSearchEngineConfig()

MediaWiki\MediaWikiServices::getSearchEngineConfig ( )
Since
1.27

Definition at line 1808 of file MediaWikiServices.php.

◆ getSearchEngineFactory()

MediaWiki\MediaWikiServices::getSearchEngineFactory ( )
Since
1.27

Definition at line 1815 of file MediaWikiServices.php.

◆ getSearchResultThumbnailProvider()

MediaWiki\MediaWikiServices::getSearchResultThumbnailProvider ( )
Since
1.40

Definition at line 1822 of file MediaWikiServices.php.

◆ getService()

MediaWiki\MediaWikiServices::getService ( $name)

Definition at line 348 of file MediaWikiServices.php.

References wfDeprecatedMsg().

◆ getShellboxClientFactory()

MediaWiki\MediaWikiServices::getShellboxClientFactory ( )
Since
1.36

Definition at line 1829 of file MediaWikiServices.php.

◆ getShellCommandFactory()

MediaWiki\MediaWikiServices::getShellCommandFactory ( )
Since
1.30

Definition at line 1836 of file MediaWikiServices.php.

◆ getSignatureValidatorFactory()

MediaWiki\MediaWikiServices::getSignatureValidatorFactory ( )
Since
1.38

Definition at line 1843 of file MediaWikiServices.php.

◆ getSiteLookup()

MediaWiki\MediaWikiServices::getSiteLookup ( )
Since
1.27

Definition at line 1850 of file MediaWikiServices.php.

◆ getSiteStore()

MediaWiki\MediaWikiServices::getSiteStore ( )
Since
1.27

Definition at line 1857 of file MediaWikiServices.php.

◆ getSkinFactory()

MediaWiki\MediaWikiServices::getSkinFactory ( )
Since
1.27

Definition at line 1864 of file MediaWikiServices.php.

◆ getSlotRoleRegistry()

MediaWiki\MediaWikiServices::getSlotRoleRegistry ( )
Since
1.33

Definition at line 1871 of file MediaWikiServices.php.

◆ getSlotRoleStore()

MediaWiki\MediaWikiServices::getSlotRoleStore ( )
Since
1.31

Definition at line 1878 of file MediaWikiServices.php.

◆ getSpamChecker()

MediaWiki\MediaWikiServices::getSpamChecker ( )
Since
1.35

Definition at line 1885 of file MediaWikiServices.php.

◆ getSpecialPageFactory()

MediaWiki\MediaWikiServices::getSpecialPageFactory ( )
Since
1.32

Definition at line 1892 of file MediaWikiServices.php.

◆ getStatsdDataFactory()

MediaWiki\MediaWikiServices::getStatsdDataFactory ( )
Since
1.27

Definition at line 1899 of file MediaWikiServices.php.

◆ getStatsFactory()

MediaWiki\MediaWikiServices::getStatsFactory ( )
Access: internal

Definition at line 1906 of file MediaWikiServices.php.

◆ getTalkPageNotificationManager()

MediaWiki\MediaWikiServices::getTalkPageNotificationManager ( )
Since
1.35

Definition at line 1913 of file MediaWikiServices.php.

◆ getTempFSFileFactory()

MediaWiki\MediaWikiServices::getTempFSFileFactory ( )
Since
1.34

Definition at line 1920 of file MediaWikiServices.php.

◆ getTempUserConfig()

MediaWiki\MediaWikiServices::getTempUserConfig ( )
Since
1.39

Definition at line 1927 of file MediaWikiServices.php.

◆ getTempUserCreator()

MediaWiki\MediaWikiServices::getTempUserCreator ( )
Since
1.39

Definition at line 1934 of file MediaWikiServices.php.

◆ getTidy()

MediaWiki\MediaWikiServices::getTidy ( )
Since
1.36

Definition at line 1941 of file MediaWikiServices.php.

◆ getTitleFactory()

MediaWiki\MediaWikiServices::getTitleFactory ( )
Since
1.35

Definition at line 1948 of file MediaWikiServices.php.

◆ getTitleFormatter()

MediaWiki\MediaWikiServices::getTitleFormatter ( )
Since
1.28

Definition at line 1955 of file MediaWikiServices.php.

◆ getTitleMatcher()

MediaWiki\MediaWikiServices::getTitleMatcher ( )
Since
1.40

Definition at line 1962 of file MediaWikiServices.php.

◆ getTitleParser()

MediaWiki\MediaWikiServices::getTitleParser ( )
Since
1.28

Definition at line 1969 of file MediaWikiServices.php.

◆ getTrackingCategories()

MediaWiki\MediaWikiServices::getTrackingCategories ( )
Since
1.38

Definition at line 1976 of file MediaWikiServices.php.

◆ getUnblockUserFactory()

MediaWiki\MediaWikiServices::getUnblockUserFactory ( )
Since
1.36

Definition at line 1983 of file MediaWikiServices.php.

◆ getUndeletePageFactory()

MediaWiki\MediaWikiServices::getUndeletePageFactory ( )
Since
1.38

Definition at line 1990 of file MediaWikiServices.php.

◆ getUploadRevisionImporter()

MediaWiki\MediaWikiServices::getUploadRevisionImporter ( )
Since
1.32

Definition at line 1997 of file MediaWikiServices.php.

◆ getUrlUtils()

MediaWiki\MediaWikiServices::getUrlUtils ( )
Since
1.39

Definition at line 2004 of file MediaWikiServices.php.

◆ getUserCache()

MediaWiki\MediaWikiServices::getUserCache ( )
Since
1.36

Definition at line 2011 of file MediaWikiServices.php.

◆ getUserEditTracker()

MediaWiki\MediaWikiServices::getUserEditTracker ( )
Since
1.35

Definition at line 2018 of file MediaWikiServices.php.

◆ getUserFactory()

MediaWiki\MediaWikiServices::getUserFactory ( )
Since
1.35

Definition at line 2025 of file MediaWikiServices.php.

◆ getUserGroupManager()

MediaWiki\MediaWikiServices::getUserGroupManager ( )
Since
1.35

Definition at line 2032 of file MediaWikiServices.php.

◆ getUserGroupManagerFactory()

MediaWiki\MediaWikiServices::getUserGroupManagerFactory ( )
Since
1.35

Definition at line 2039 of file MediaWikiServices.php.

◆ getUserIdentityLookup()

MediaWiki\MediaWikiServices::getUserIdentityLookup ( )
Since
1.36

Definition at line 2046 of file MediaWikiServices.php.

◆ getUserIdentityUtils()

MediaWiki\MediaWikiServices::getUserIdentityUtils ( )
Since
1.41

Definition at line 2053 of file MediaWikiServices.php.

◆ getUserNamePrefixSearch()

MediaWiki\MediaWikiServices::getUserNamePrefixSearch ( )
Since
1.36

Definition at line 2060 of file MediaWikiServices.php.

◆ getUserNameUtils()

MediaWiki\MediaWikiServices::getUserNameUtils ( )
Since
1.35

Definition at line 2067 of file MediaWikiServices.php.

◆ getUserOptionsLookup()

MediaWiki\MediaWikiServices::getUserOptionsLookup ( )
Since
1.35

Definition at line 2074 of file MediaWikiServices.php.

◆ getUserOptionsManager()

MediaWiki\MediaWikiServices::getUserOptionsManager ( )
Since
1.35

Definition at line 2081 of file MediaWikiServices.php.

◆ getUserRegistrationLookup()

MediaWiki\MediaWikiServices::getUserRegistrationLookup ( )
Since
1.41

Definition at line 2088 of file MediaWikiServices.php.

◆ getWatchedItemQueryService()

MediaWiki\MediaWikiServices::getWatchedItemQueryService ( )
Since
1.28

Definition at line 2095 of file MediaWikiServices.php.

◆ getWatchedItemStore()

MediaWiki\MediaWikiServices::getWatchedItemStore ( )
Since
1.28

Definition at line 2102 of file MediaWikiServices.php.

◆ getWatchlistManager()

MediaWiki\MediaWikiServices::getWatchlistManager ( )
Since
1.36

Definition at line 2109 of file MediaWikiServices.php.

◆ getWikiExporterFactory()

MediaWiki\MediaWikiServices::getWikiExporterFactory ( )
Since
1.38

Definition at line 2116 of file MediaWikiServices.php.

◆ getWikiImporterFactory()

MediaWiki\MediaWikiServices::getWikiImporterFactory ( )
Since
1.37

Definition at line 2123 of file MediaWikiServices.php.

◆ getWikiPageFactory()

MediaWiki\MediaWikiServices::getWikiPageFactory ( )
Since
1.36

Definition at line 2130 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporter()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporter ( )
Since
1.31

Definition at line 2137 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporterNoUpdates()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporterNoUpdates ( )
Since
1.31

Definition at line 2144 of file MediaWikiServices.php.

◆ getWikiRevisionUploadImporter()

MediaWiki\MediaWikiServices::getWikiRevisionUploadImporter ( )
Since
1.31

Definition at line 2151 of file MediaWikiServices.php.

◆ getWRStatsFactory()

MediaWiki\MediaWikiServices::getWRStatsFactory ( )
Since
1.39

Definition at line 2158 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 304 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 582 of file MediaWikiServices.php.

◆ newSearchEngine()

MediaWiki\MediaWikiServices::newSearchEngine ( )
Since
1.27

Definition at line 1800 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 598 of file MediaWikiServices.php.

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

◆ resetGlobalInstance()

static MediaWiki\MediaWikiServices::resetGlobalInstance ( Config $bootstrapConfig = null,
$quick = '' )
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$quickSet this to "quick" to allow expensive resources to be re-used. See SalvageableService for details.

Definition at line 415 of file MediaWikiServices.php.

References $runner.

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

◆ 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 627 of file MediaWikiServices.php.


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