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 ()
 
 getBootstrapConfig ()
 Returns the Config object containing the bootstrap configuration.
 
 getBotPasswordStore ()
 
 getCentralIdLookup ()
 
 getCentralIdLookupFactory ()
 
 getChangeTagDefStore ()
 
 getChangeTagsStore ()
 
 getChronologyProtector ()
 
 getCollationFactory ()
 
 getCommentFormatter ()
 
 getCommentParserFactory ()
 
 getCommentStore ()
 
 getConfigFactory ()
 
 getConfigRepository ()
 
 getConfigSchema ()
 
 getConfiguredReadOnlyMode ()
 
 getContentHandlerFactory ()
 
 getContentLanguage ()
 
 getContentModelChangeFactory ()
 
 getContentModelStore ()
 
 getContentRenderer ()
 
 getContentTransformer ()
 
 getContributionsLookup ()
 
 getCriticalSectionProvider ()
 
 getCryptHKDF ()
 
 getDatabaseBlockStore ()
 
 getDatabaseBlockStoreFactory ()
 
 getDatabaseFactory ()
 
 getDateFormatterFactory ()
 
 getDBLoadBalancer ()
 
 getDBLoadBalancerFactory ()
 
 getDBLoadBalancerFactoryConfigBuilder ()
 
 getDefaultOutputTransform ()
 
 getDeletePageFactory ()
 
 getEmailer ()
 
 getEmailUserFactory ()
 
 getEventRelayerGroup ()
 
 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 ()
 
 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 ()
 
 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 235 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 669 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 265 of file MediaWikiServices.php.

◆ allowGlobalInstanceAfterUnitTests()

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

Definition at line 289 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 520 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 500 of file MediaWikiServices.php.

◆ disallowGlobalInstanceInUnitTests()

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

Definition at line 279 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 653 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 364 of file MediaWikiServices.php.

◆ getActionFactory()

MediaWiki\MediaWikiServices::getActionFactory ( )
Since
1.37

Definition at line 683 of file MediaWikiServices.php.

◆ getActorMigration()

MediaWiki\MediaWikiServices::getActorMigration ( )
Since
1.31

Definition at line 690 of file MediaWikiServices.php.

◆ getActorNormalization()

MediaWiki\MediaWikiServices::getActorNormalization ( )
Since
1.36

Definition at line 697 of file MediaWikiServices.php.

◆ getActorStore()

MediaWiki\MediaWikiServices::getActorStore ( )
Since
1.36

Definition at line 704 of file MediaWikiServices.php.

◆ getActorStoreFactory()

MediaWiki\MediaWikiServices::getActorStoreFactory ( )
Since
1.36

Definition at line 711 of file MediaWikiServices.php.

◆ getArchivedRevisionLookup()

MediaWiki\MediaWikiServices::getArchivedRevisionLookup ( )
Since
1.38

Definition at line 718 of file MediaWikiServices.php.

◆ getAuthManager()

MediaWiki\MediaWikiServices::getAuthManager ( )
Since
1.35

Definition at line 725 of file MediaWikiServices.php.

◆ getAutoblockExemptionList()

MediaWiki\MediaWikiServices::getAutoblockExemptionList ( )
Since
1.42

Definition at line 732 of file MediaWikiServices.php.

◆ getBacklinkCacheFactory()

MediaWiki\MediaWikiServices::getBacklinkCacheFactory ( )
Since
1.37

Definition at line 739 of file MediaWikiServices.php.

◆ getBadFileLookup()

MediaWiki\MediaWikiServices::getBadFileLookup ( )
Since
1.34

Definition at line 746 of file MediaWikiServices.php.

◆ getBlobStore()

MediaWiki\MediaWikiServices::getBlobStore ( )
Since
1.31

Definition at line 753 of file MediaWikiServices.php.

◆ getBlobStoreFactory()

MediaWiki\MediaWikiServices::getBlobStoreFactory ( )
Since
1.31

Definition at line 760 of file MediaWikiServices.php.

◆ getBlockActionInfo()

MediaWiki\MediaWikiServices::getBlockActionInfo ( )
Since
1.37

Definition at line 767 of file MediaWikiServices.php.

◆ getBlockErrorFormatter()

MediaWiki\MediaWikiServices::getBlockErrorFormatter ( )
Since
1.35

Definition at line 774 of file MediaWikiServices.php.

◆ getBlockManager()

MediaWiki\MediaWikiServices::getBlockManager ( )
Since
1.34

Definition at line 781 of file MediaWikiServices.php.

◆ getBlockPermissionCheckerFactory()

MediaWiki\MediaWikiServices::getBlockPermissionCheckerFactory ( )
Since
1.35

Definition at line 788 of file MediaWikiServices.php.

◆ getBlockRestrictionStore()

MediaWiki\MediaWikiServices::getBlockRestrictionStore ( )
Since
1.33

Definition at line 795 of file MediaWikiServices.php.

◆ getBlockRestrictionStoreFactory()

MediaWiki\MediaWikiServices::getBlockRestrictionStoreFactory ( )
Since
1.38

Definition at line 802 of file MediaWikiServices.php.

◆ getBlockUserFactory()

MediaWiki\MediaWikiServices::getBlockUserFactory ( )
Since
1.36

Definition at line 809 of file MediaWikiServices.php.

◆ getBlockUtils()

MediaWiki\MediaWikiServices::getBlockUtils ( )
Since
1.36

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

◆ getBotPasswordStore()

MediaWiki\MediaWikiServices::getBotPasswordStore ( )
Since
1.37

Definition at line 839 of file MediaWikiServices.php.

◆ getCentralIdLookup()

MediaWiki\MediaWikiServices::getCentralIdLookup ( )
Since
1.37

Definition at line 846 of file MediaWikiServices.php.

◆ getCentralIdLookupFactory()

MediaWiki\MediaWikiServices::getCentralIdLookupFactory ( )
Since
1.37

Definition at line 853 of file MediaWikiServices.php.

◆ getChangeTagDefStore()

MediaWiki\MediaWikiServices::getChangeTagDefStore ( )
Since
1.32

Definition at line 860 of file MediaWikiServices.php.

◆ getChangeTagsStore()

MediaWiki\MediaWikiServices::getChangeTagsStore ( )
Since
1.41

Definition at line 867 of file MediaWikiServices.php.

◆ getChronologyProtector()

MediaWiki\MediaWikiServices::getChronologyProtector ( )
Since
1.41

Definition at line 874 of file MediaWikiServices.php.

◆ getCollationFactory()

MediaWiki\MediaWikiServices::getCollationFactory ( )
Since
1.37

Definition at line 881 of file MediaWikiServices.php.

◆ getCommentFormatter()

MediaWiki\MediaWikiServices::getCommentFormatter ( )
Since
1.38

Definition at line 888 of file MediaWikiServices.php.

◆ getCommentParserFactory()

MediaWiki\MediaWikiServices::getCommentParserFactory ( )
Since
1.41

Definition at line 895 of file MediaWikiServices.php.

◆ getCommentStore()

MediaWiki\MediaWikiServices::getCommentStore ( )
Since
1.31

Definition at line 902 of file MediaWikiServices.php.

◆ getConfigFactory()

MediaWiki\MediaWikiServices::getConfigFactory ( )
Since
1.27

Definition at line 909 of file MediaWikiServices.php.

◆ getConfigRepository()

MediaWiki\MediaWikiServices::getConfigRepository ( )
Since
1.32

Definition at line 916 of file MediaWikiServices.php.

◆ getConfigSchema()

MediaWiki\MediaWikiServices::getConfigSchema ( )
Since
1.39

Definition at line 923 of file MediaWikiServices.php.

◆ getConfiguredReadOnlyMode()

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

Definition at line 931 of file MediaWikiServices.php.

◆ getContentHandlerFactory()

MediaWiki\MediaWikiServices::getContentHandlerFactory ( )
Since
1.35

Definition at line 938 of file MediaWikiServices.php.

◆ getContentLanguage()

MediaWiki\MediaWikiServices::getContentLanguage ( )
Since
1.32

Definition at line 945 of file MediaWikiServices.php.

◆ getContentModelChangeFactory()

MediaWiki\MediaWikiServices::getContentModelChangeFactory ( )
Since
1.35

Definition at line 952 of file MediaWikiServices.php.

◆ getContentModelStore()

MediaWiki\MediaWikiServices::getContentModelStore ( )
Since
1.31

Definition at line 959 of file MediaWikiServices.php.

◆ getContentRenderer()

MediaWiki\MediaWikiServices::getContentRenderer ( )
Since
1.38

Definition at line 966 of file MediaWikiServices.php.

◆ getContentTransformer()

MediaWiki\MediaWikiServices::getContentTransformer ( )
Since
1.37

Definition at line 973 of file MediaWikiServices.php.

◆ getContributionsLookup()

MediaWiki\MediaWikiServices::getContributionsLookup ( )
Since
1.35

Definition at line 980 of file MediaWikiServices.php.

◆ getCriticalSectionProvider()

MediaWiki\MediaWikiServices::getCriticalSectionProvider ( )
Since
1.36

Definition at line 987 of file MediaWikiServices.php.

◆ getCryptHKDF()

MediaWiki\MediaWikiServices::getCryptHKDF ( )
Since
1.28

Definition at line 994 of file MediaWikiServices.php.

◆ getDatabaseBlockStore()

MediaWiki\MediaWikiServices::getDatabaseBlockStore ( )
Since
1.36

Definition at line 1001 of file MediaWikiServices.php.

◆ getDatabaseBlockStoreFactory()

MediaWiki\MediaWikiServices::getDatabaseBlockStoreFactory ( )
Since
1.40

Definition at line 1008 of file MediaWikiServices.php.

◆ getDatabaseFactory()

MediaWiki\MediaWikiServices::getDatabaseFactory ( )
Since
1.39

Definition at line 1015 of file MediaWikiServices.php.

◆ getDateFormatterFactory()

MediaWiki\MediaWikiServices::getDateFormatterFactory ( )
Since
1.33

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

◆ getDBLoadBalancerFactory()

MediaWiki\MediaWikiServices::getDBLoadBalancerFactory ( )
Since
1.28

Definition at line 1037 of file MediaWikiServices.php.

◆ getDBLoadBalancerFactoryConfigBuilder()

MediaWiki\MediaWikiServices::getDBLoadBalancerFactoryConfigBuilder ( )
Since
1.39

Definition at line 1044 of file MediaWikiServices.php.

◆ getDefaultOutputTransform()

MediaWiki\MediaWikiServices::getDefaultOutputTransform ( )
Access: internal

Definition at line 1051 of file MediaWikiServices.php.

◆ getDeletePageFactory()

MediaWiki\MediaWikiServices::getDeletePageFactory ( )
Since
1.37

Definition at line 1058 of file MediaWikiServices.php.

◆ getEmailer()

MediaWiki\MediaWikiServices::getEmailer ( )
Since
1.35

Definition at line 1065 of file MediaWikiServices.php.

◆ getEmailUserFactory()

MediaWiki\MediaWikiServices::getEmailUserFactory ( )
Since
1.41

Definition at line 1072 of file MediaWikiServices.php.

◆ getEventRelayerGroup()

MediaWiki\MediaWikiServices::getEventRelayerGroup ( )
Since
1.27

Definition at line 1079 of file MediaWikiServices.php.

◆ getExternalStoreAccess()

MediaWiki\MediaWikiServices::getExternalStoreAccess ( )
Since
1.34

Definition at line 1086 of file MediaWikiServices.php.

◆ getExternalStoreFactory()

MediaWiki\MediaWikiServices::getExternalStoreFactory ( )
Since
1.31

Definition at line 1093 of file MediaWikiServices.php.

◆ getFileBackendGroup()

MediaWiki\MediaWikiServices::getFileBackendGroup ( )
Since
1.35

Definition at line 1100 of file MediaWikiServices.php.

◆ getFormatterFactory()

MediaWiki\MediaWikiServices::getFormatterFactory ( )
Since
1.41

Definition at line 1107 of file MediaWikiServices.php.

◆ getGenderCache()

MediaWiki\MediaWikiServices::getGenderCache ( )
Since
1.28

Definition at line 1114 of file MediaWikiServices.php.

◆ getGlobalIdGenerator()

MediaWiki\MediaWikiServices::getGlobalIdGenerator ( )
Since
1.35

Definition at line 1121 of file MediaWikiServices.php.

◆ getGrantsInfo()

MediaWiki\MediaWikiServices::getGrantsInfo ( )
Since
1.38

Definition at line 1128 of file MediaWikiServices.php.

◆ getGrantsLocalization()

MediaWiki\MediaWikiServices::getGrantsLocalization ( )
Since
1.38

Definition at line 1135 of file MediaWikiServices.php.

◆ getGroupPermissionsLookup()

MediaWiki\MediaWikiServices::getGroupPermissionsLookup ( )
Since
1.36

Definition at line 1142 of file MediaWikiServices.php.

◆ getHideUserUtils()

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

Definition at line 1150 of file MediaWikiServices.php.

◆ getHookContainer()

MediaWiki\MediaWikiServices::getHookContainer ( )
Since
1.35

Definition at line 1157 of file MediaWikiServices.php.

◆ getHtmlCacheUpdater()

MediaWiki\MediaWikiServices::getHtmlCacheUpdater ( )
Since
1.35

Definition at line 1164 of file MediaWikiServices.php.

◆ getHtmlTransformFactory()

MediaWiki\MediaWikiServices::getHtmlTransformFactory ( )
Since
1.39

Definition at line 1171 of file MediaWikiServices.php.

◆ getHttpRequestFactory()

MediaWiki\MediaWikiServices::getHttpRequestFactory ( )
Since
1.31

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

References wfDeprecatedMsg().

Referenced by MediaWiki\Specials\SpecialRandomPage\__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\ResourceLoader\ForeignResourceManager\__construct(), MediaWiki\Utils\GitInfo\__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\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\Preferences\DefaultPreferencesFactory\__construct(), MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\PHPSessionHandler\__construct(), MediaWiki\Deferred\JobQueueEnqueueUpdate\__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\Html\Html\buttonAttributes(), MediaWiki\Deferred\SiteStatsUpdate\cacheUpdate(), MediaWiki\Specials\SpecialBlock\canBlockEmail(), MediaWiki\Specials\SpecialPageLanguage\changePageLanguage(), MediaWiki\Feed\FeedUtils\checkFeedOutput(), MediaWiki\User\User\checkPasswordValidity(), MediaWiki\SpecialPage\SpecialPage\checkReadOnly(), MediaWiki\SpecialPage\ChangesListSpecialPage\checkStructuredFilterUiEnabled(), MediaWiki\Specials\SpecialWatchlist\checkStructuredFilterUiEnabled(), MediaWiki\User\User\clearInstanceCache(), MediaWiki\SpecialPage\ChangesListSpecialPage\considerActionsForDefaultSavedQuery(), MediaWiki\Output\StreamFile\contentTypeFromPath(), MediaWiki\Block\DatabaseBlock\delete(), MediaWiki\User\BotPassword\delete(), MediaWiki\Block\DatabaseBlock\doAutoblock(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), 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\SpecialPage\ChangesListSpecialPage\execute(), MediaWiki\SpecialPage\LoginSignupSpecialPage\execute(), MediaWiki\ResourceLoader\FileModule\extractBasePaths(), MediaWiki\User\CentralId\CentralIdLookup\factory(), MediaWiki\User\User\findUsersByGroup(), MediaWiki\Feed\FeedUtils\formatDiff(), MediaWiki\Feed\FeedUtils\formatDiffRow(), MediaWiki\Feed\FeedUtils\formatDiffRow2(), MediaWiki\Deferred\LinksUpdate\LinksTableGroup\get(), MediaWiki\SpecialPage\SpecialPage\getAuthManager(), MediaWiki\User\User\getCacheKey(), MediaWiki\WikiMap\WikiMap\getCanonicalServerInfoForAllWikis(), MediaWiki\SpecialPage\ChangesListSpecialPage\getCollapsedPreferenceName(), MediaWiki\ResourceLoader\WikiModule\getContent(), MediaWiki\ResourceLoader\WikiModule\getContentObj(), MediaWiki\Request\FauxRequest\getCookie(), MediaWiki\Pager\AllMessagesTablePager\getCustomisedStatuses(), MediaWiki\User\BotPassword\getDB(), MediaWiki\ResourceLoader\WikiModule\getDB(), MediaWiki\SpecialPage\QueryPage\getDBLoadBalancer(), MediaWiki\SpecialPage\ChangesListSpecialPage\getDefaultDays(), MediaWiki\Config\ConfigFactory\getDefaultInstance(), MediaWiki\SpecialPage\ChangesListSpecialPage\getDefaultLimit(), MediaWiki\Specials\SpecialVersion\getExtensionTypes(), MediaWiki\SpecialPage\LoginSignupSpecialPage\getFieldDefinitions(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\ResourceLoader\Module\getFlip(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\Specials\SpecialUpload\getInitialPageText(), MediaWiki\Linker\Linker\getInvalidTitleDescription(), MediaWiki\Feed\FeedItem\getLanguage(), MediaWiki\SpecialPage\PageQueryPage\getLanguageConverter(), MediaWiki\SpecialPage\QueryPage\getLinkBatchFactory(), 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\Specials\SpecialEmailUser\getPermissionsError(), 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\User\BotPassword\getSeparator(), MediaWiki\Specials\SpecialEmailUser\getTarget(), MediaWiki\Html\TemplateParser\getTemplate(), MediaWiki\EditPage\TextboxBuilder\getTextboxProtectionCSSClasses(), MediaWiki\Html\Html\getTextInputAttributes(), MediaWiki\SpecialPage\SpecialPage\getTitleValueFor(), MediaWiki\Linker\Linker\getUploadUrl(), MediaWiki\User\ExternalUserNames\getUserLinkTitle(), MediaWiki\Output\OutputHandler\handle(), MediaWiki\Html\Html\htmlHeader(), MediaWiki\Feed\ChannelFeed\httpHeaders(), MediaWiki\SpecialPage\ChangesListSpecialPage\includeRcFiltersApp(), MediaWiki\Block\DatabaseBlock\insert(), MediaWiki\User\BotPassword\invalidateAllPasswordsForCentralId(), MediaWiki\User\BotPassword\invalidateAllPasswordsForUser(), MediaWiki\Block\DatabaseBlock\isExemptedFromAutoblocks(), MediaWiki\User\User\isPingLimitable(), MediaWiki\SpecialPage\SpecialPage\isRestricted(), MediaWiki\SiteStats\SiteStats\jobs(), 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\User\User\loadFromCache(), MediaWiki\User\User\loadFromRow(), MediaWiki\User\BotPassword\login(), MediaWiki\Session\SessionManager\logPotentialSessionLeakage(), MediaWiki\Rest\EntryPoint\main(), MediaWiki\SpecialPage\LoginSignupSpecialPage\mainLoginForm(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Linker\Linker\makeExternalImage(), MediaWiki\Linker\Linker\makeExternalLink(), MediaWiki\Linker\Linker\makeImageLink(), 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\User\User\newFromActorId(), MediaWiki\User\User\newFromAnyId(), MediaWiki\User\BotPassword\newFromCentralId(), 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\BotPassword\newFromUser(), MediaWiki\User\ActorMigration\newMigration(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), MediaWiki\SpecialPage\SpecialPage\newSearchPage(), MediaWiki\User\User\newSystemUser(), MediaWiki\User\BotPassword\newUnsaved(), 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\SpecialPage\SpecialPage\prefixSearchString(), MediaWiki\ExternalLinks\LinkFilter\prepareProtocols(), MediaWiki\Specials\SpecialBlock\processForm(), MediaWiki\Linker\Linker\processResponsiveImages(), MediaWiki\User\User\purge(), MediaWiki\Deferred\CdnCacheUpdate\purge(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable(), MediaWiki\ResourceLoader\MessageBlobStore\recacheMessageBlob(), MediaWiki\SiteStats\SiteStatsInit\refresh(), MediaWiki\User\BotPassword\removeAllPasswordsForCentralId(), MediaWiki\User\BotPassword\removeAllPasswordsForUser(), MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\render(), MediaWiki\Session\SessionBackend\save(), MediaWiki\User\BotPassword\save(), MediaWiki\Request\WebResponse\setCookie(), MediaWiki\Request\FauxRequest\setCookies(), MediaWiki\Specials\SpecialEmailUser\submit(), MediaWiki\Block\DatabaseBlock\update(), MediaWiki\Deferred\SearchUpdate\updateText(), MediaWiki\Block\DatabaseBlock\updateTimestamp(), MediaWiki\SpecialPage\SpecialPage\userCanExecute(), MediaWiki\Linker\Linker\userLink(), and MediaWiki\Specials\SpecialEmailUser\validateTarget().

◆ getInterwikiLookup()

MediaWiki\MediaWikiServices::getInterwikiLookup ( )
Since
1.28

Definition at line 1185 of file MediaWikiServices.php.

◆ getIntroMessageBuilder()

MediaWiki\MediaWikiServices::getIntroMessageBuilder ( )
Since
1.41

Definition at line 1192 of file MediaWikiServices.php.

◆ getJobFactory()

MediaWiki\MediaWikiServices::getJobFactory ( )
Since
1.40

Definition at line 1199 of file MediaWikiServices.php.

◆ getJobQueueGroup()

MediaWiki\MediaWikiServices::getJobQueueGroup ( )
Since
1.37

Definition at line 1206 of file MediaWikiServices.php.

◆ getJobQueueGroupFactory()

MediaWiki\MediaWikiServices::getJobQueueGroupFactory ( )
Since
1.37

Definition at line 1213 of file MediaWikiServices.php.

◆ getJobRunner()

MediaWiki\MediaWikiServices::getJobRunner ( )
Since
1.35

Definition at line 1220 of file MediaWikiServices.php.

◆ getJsonCodec()

MediaWiki\MediaWikiServices::getJsonCodec ( )
Since
1.36

Definition at line 1227 of file MediaWikiServices.php.

◆ getLanguageConverterFactory()

MediaWiki\MediaWikiServices::getLanguageConverterFactory ( )
Since
1.35

Definition at line 1234 of file MediaWikiServices.php.

◆ getLanguageFactory()

MediaWiki\MediaWikiServices::getLanguageFactory ( )
Since
1.35

Definition at line 1241 of file MediaWikiServices.php.

◆ getLanguageFallback()

MediaWiki\MediaWikiServices::getLanguageFallback ( )
Since
1.35

Definition at line 1248 of file MediaWikiServices.php.

◆ getLanguageNameUtils()

MediaWiki\MediaWikiServices::getLanguageNameUtils ( )
Since
1.34

Definition at line 1255 of file MediaWikiServices.php.

◆ getLinkBatchFactory()

MediaWiki\MediaWikiServices::getLinkBatchFactory ( )
Since
1.35

Definition at line 1262 of file MediaWikiServices.php.

◆ getLinkCache()

MediaWiki\MediaWikiServices::getLinkCache ( )
Since
1.28

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

◆ getLinkRendererFactory()

MediaWiki\MediaWikiServices::getLinkRendererFactory ( )
Since
1.28

Definition at line 1286 of file MediaWikiServices.php.

◆ getLinksMigration()

MediaWiki\MediaWikiServices::getLinksMigration ( )
Since
1.39

Definition at line 1293 of file MediaWikiServices.php.

◆ getLinkTargetLookup()

MediaWiki\MediaWikiServices::getLinkTargetLookup ( )
Since
1.38

Definition at line 1300 of file MediaWikiServices.php.

◆ getLocalisationCache()

MediaWiki\MediaWikiServices::getLocalisationCache ( )
Since
1.34

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

◆ getLockManagerGroupFactory()

MediaWiki\MediaWikiServices::getLockManagerGroupFactory ( )
Since
1.34

Definition at line 1326 of file MediaWikiServices.php.

◆ getMagicWordFactory()

MediaWiki\MediaWikiServices::getMagicWordFactory ( )
Since
1.32

Definition at line 1333 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 1343 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 1354 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 1365 of file MediaWikiServices.php.

◆ getMediaHandlerFactory()

MediaWiki\MediaWikiServices::getMediaHandlerFactory ( )
Since
1.28

Definition at line 1372 of file MediaWikiServices.php.

◆ getMergeHistoryFactory()

MediaWiki\MediaWikiServices::getMergeHistoryFactory ( )
Since
1.35

Definition at line 1379 of file MediaWikiServices.php.

◆ getMessageCache()

MediaWiki\MediaWikiServices::getMessageCache ( )
Since
1.34

Definition at line 1386 of file MediaWikiServices.php.

◆ getMessageFormatterFactory()

MediaWiki\MediaWikiServices::getMessageFormatterFactory ( )
Since
1.34

Definition at line 1393 of file MediaWikiServices.php.

◆ getMicroStash()

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

Definition at line 1402 of file MediaWikiServices.php.

◆ getMimeAnalyzer()

MediaWiki\MediaWikiServices::getMimeAnalyzer ( )
Since
1.28

Definition at line 1409 of file MediaWikiServices.php.

◆ getMovePageFactory()

MediaWiki\MediaWikiServices::getMovePageFactory ( )
Since
1.34

Definition at line 1416 of file MediaWikiServices.php.

◆ getNamespaceInfo()

MediaWiki\MediaWikiServices::getNamespaceInfo ( )
Since
1.34

Definition at line 1423 of file MediaWikiServices.php.

◆ getNameTableStoreFactory()

MediaWiki\MediaWikiServices::getNameTableStoreFactory ( )
Since
1.32

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

◆ getOldRevisionImporter()

MediaWiki\MediaWikiServices::getOldRevisionImporter ( )
Since
1.32

Definition at line 1447 of file MediaWikiServices.php.

◆ getPageEditStash()

MediaWiki\MediaWikiServices::getPageEditStash ( )
Since
1.34

Definition at line 1454 of file MediaWikiServices.php.

◆ getPageProps()

MediaWiki\MediaWikiServices::getPageProps ( )
Since
1.36

Definition at line 1461 of file MediaWikiServices.php.

◆ getPageRestHelperFactory()

MediaWiki\MediaWikiServices::getPageRestHelperFactory ( )
Since
1.40

Definition at line 1468 of file MediaWikiServices.php.

◆ getPageStore()

MediaWiki\MediaWikiServices::getPageStore ( )
Since
1.36

Definition at line 1475 of file MediaWikiServices.php.

◆ getPageStoreFactory()

MediaWiki\MediaWikiServices::getPageStoreFactory ( )
Since
1.36

Definition at line 1482 of file MediaWikiServices.php.

◆ getPageUpdaterFactory()

MediaWiki\MediaWikiServices::getPageUpdaterFactory ( )
Since
1.37

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

◆ getParserCache()

MediaWiki\MediaWikiServices::getParserCache ( )
Since
1.30

Definition at line 1513 of file MediaWikiServices.php.

◆ getParserCacheFactory()

MediaWiki\MediaWikiServices::getParserCacheFactory ( )
Since
1.36

Definition at line 1520 of file MediaWikiServices.php.

◆ getParserFactory()

MediaWiki\MediaWikiServices::getParserFactory ( )
Since
1.32

Definition at line 1527 of file MediaWikiServices.php.

◆ getParserOutputAccess()

MediaWiki\MediaWikiServices::getParserOutputAccess ( )
Since
1.36

Definition at line 1534 of file MediaWikiServices.php.

◆ getParsoidDataAccess()

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

Definition at line 1542 of file MediaWikiServices.php.

◆ getParsoidOutputAccess()

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

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

◆ getParsoidPageConfigFactory()

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

Definition at line 1566 of file MediaWikiServices.php.

◆ getParsoidParserFactory()

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

Definition at line 1574 of file MediaWikiServices.php.

◆ getParsoidSiteConfig()

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

Definition at line 1582 of file MediaWikiServices.php.

◆ getPasswordFactory()

MediaWiki\MediaWikiServices::getPasswordFactory ( )
Since
1.32

Definition at line 1589 of file MediaWikiServices.php.

◆ getPasswordReset()

MediaWiki\MediaWikiServices::getPasswordReset ( )
Since
1.34

Definition at line 1596 of file MediaWikiServices.php.

◆ getPerDbNameStatsdDataFactory()

MediaWiki\MediaWikiServices::getPerDbNameStatsdDataFactory ( )
Since
1.32

Definition at line 1603 of file MediaWikiServices.php.

◆ getPermissionManager()

MediaWiki\MediaWikiServices::getPermissionManager ( )
Since
1.33

Definition at line 1610 of file MediaWikiServices.php.

◆ getPingback()

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

Definition at line 1618 of file MediaWikiServices.php.

◆ getPoolCounterFactory()

MediaWiki\MediaWikiServices::getPoolCounterFactory ( )
Since
1.40

Definition at line 1625 of file MediaWikiServices.php.

◆ getPreferencesFactory()

MediaWiki\MediaWikiServices::getPreferencesFactory ( )
Since
1.31

Definition at line 1632 of file MediaWikiServices.php.

◆ getPreloadedContentBuilder()

MediaWiki\MediaWikiServices::getPreloadedContentBuilder ( )
Since
1.41

Definition at line 1639 of file MediaWikiServices.php.

◆ getProxyLookup()

MediaWiki\MediaWikiServices::getProxyLookup ( )
Since
1.28

Definition at line 1646 of file MediaWikiServices.php.

◆ getRateLimiter()

MediaWiki\MediaWikiServices::getRateLimiter ( )
Since
1.39

Definition at line 1653 of file MediaWikiServices.php.

◆ getReadOnlyMode()

MediaWiki\MediaWikiServices::getReadOnlyMode ( )
Since
1.29

Definition at line 1660 of file MediaWikiServices.php.

◆ getRedirectLookup()

MediaWiki\MediaWikiServices::getRedirectLookup ( )
Since
1.38

Definition at line 1667 of file MediaWikiServices.php.

◆ getRedirectStore()

MediaWiki\MediaWikiServices::getRedirectStore ( )
Since
1.38

Definition at line 1674 of file MediaWikiServices.php.

◆ getRepoGroup()

MediaWiki\MediaWikiServices::getRepoGroup ( )
Since
1.34

Definition at line 1681 of file MediaWikiServices.php.

◆ getResourceLoader()

MediaWiki\MediaWikiServices::getResourceLoader ( )
Since
1.33

Definition at line 1688 of file MediaWikiServices.php.

◆ getRestrictionStore()

MediaWiki\MediaWikiServices::getRestrictionStore ( )
Since
1.37

Definition at line 1695 of file MediaWikiServices.php.

◆ getRevertedTagUpdateManager()

MediaWiki\MediaWikiServices::getRevertedTagUpdateManager ( )
Since
1.36

Definition at line 1702 of file MediaWikiServices.php.

◆ getRevisionFactory()

MediaWiki\MediaWikiServices::getRevisionFactory ( )
Since
1.31

Definition at line 1709 of file MediaWikiServices.php.

◆ getRevisionLookup()

MediaWiki\MediaWikiServices::getRevisionLookup ( )
Since
1.31

Definition at line 1716 of file MediaWikiServices.php.

◆ getRevisionRenderer()

MediaWiki\MediaWikiServices::getRevisionRenderer ( )
Since
1.32

Definition at line 1723 of file MediaWikiServices.php.

◆ getRevisionStore()

MediaWiki\MediaWikiServices::getRevisionStore ( )
Since
1.31

Definition at line 1730 of file MediaWikiServices.php.

◆ getRevisionStoreFactory()

MediaWiki\MediaWikiServices::getRevisionStoreFactory ( )
Since
1.32

Definition at line 1737 of file MediaWikiServices.php.

◆ getRollbackPageFactory()

MediaWiki\MediaWikiServices::getRollbackPageFactory ( )
Since
1.37

Definition at line 1744 of file MediaWikiServices.php.

◆ getRowCommentFormatter()

MediaWiki\MediaWikiServices::getRowCommentFormatter ( )
Since
1.38

Definition at line 1751 of file MediaWikiServices.php.

◆ getSearchEngineConfig()

MediaWiki\MediaWikiServices::getSearchEngineConfig ( )
Since
1.27

Definition at line 1766 of file MediaWikiServices.php.

◆ getSearchEngineFactory()

MediaWiki\MediaWikiServices::getSearchEngineFactory ( )
Since
1.27

Definition at line 1773 of file MediaWikiServices.php.

◆ getSearchResultThumbnailProvider()

MediaWiki\MediaWikiServices::getSearchResultThumbnailProvider ( )
Since
1.40

Definition at line 1780 of file MediaWikiServices.php.

◆ getService()

MediaWiki\MediaWikiServices::getService (   $name)

Definition at line 344 of file MediaWikiServices.php.

References wfDeprecatedMsg().

◆ getShellboxClientFactory()

MediaWiki\MediaWikiServices::getShellboxClientFactory ( )
Since
1.36

Definition at line 1787 of file MediaWikiServices.php.

◆ getShellCommandFactory()

MediaWiki\MediaWikiServices::getShellCommandFactory ( )
Since
1.30

Definition at line 1794 of file MediaWikiServices.php.

◆ getSignatureValidatorFactory()

MediaWiki\MediaWikiServices::getSignatureValidatorFactory ( )
Since
1.38

Definition at line 1801 of file MediaWikiServices.php.

◆ getSiteLookup()

MediaWiki\MediaWikiServices::getSiteLookup ( )
Since
1.27

Definition at line 1808 of file MediaWikiServices.php.

◆ getSiteStore()

MediaWiki\MediaWikiServices::getSiteStore ( )
Since
1.27

Definition at line 1815 of file MediaWikiServices.php.

◆ getSkinFactory()

MediaWiki\MediaWikiServices::getSkinFactory ( )
Since
1.27

Definition at line 1822 of file MediaWikiServices.php.

◆ getSlotRoleRegistry()

MediaWiki\MediaWikiServices::getSlotRoleRegistry ( )
Since
1.33

Definition at line 1829 of file MediaWikiServices.php.

◆ getSlotRoleStore()

MediaWiki\MediaWikiServices::getSlotRoleStore ( )
Since
1.31

Definition at line 1836 of file MediaWikiServices.php.

◆ getSpamChecker()

MediaWiki\MediaWikiServices::getSpamChecker ( )
Since
1.35

Definition at line 1843 of file MediaWikiServices.php.

◆ getSpecialPageFactory()

MediaWiki\MediaWikiServices::getSpecialPageFactory ( )
Since
1.32

Definition at line 1850 of file MediaWikiServices.php.

◆ getStatsdDataFactory()

MediaWiki\MediaWikiServices::getStatsdDataFactory ( )
Since
1.27

Definition at line 1857 of file MediaWikiServices.php.

◆ getStatsFactory()

MediaWiki\MediaWikiServices::getStatsFactory ( )
Access: internal

Definition at line 1864 of file MediaWikiServices.php.

◆ getTalkPageNotificationManager()

MediaWiki\MediaWikiServices::getTalkPageNotificationManager ( )
Since
1.35

Definition at line 1871 of file MediaWikiServices.php.

◆ getTempFSFileFactory()

MediaWiki\MediaWikiServices::getTempFSFileFactory ( )
Since
1.34

Definition at line 1878 of file MediaWikiServices.php.

◆ getTempUserConfig()

MediaWiki\MediaWikiServices::getTempUserConfig ( )
Since
1.39

Definition at line 1885 of file MediaWikiServices.php.

◆ getTempUserCreator()

MediaWiki\MediaWikiServices::getTempUserCreator ( )
Since
1.39

Definition at line 1892 of file MediaWikiServices.php.

◆ getTidy()

MediaWiki\MediaWikiServices::getTidy ( )
Since
1.36

Definition at line 1899 of file MediaWikiServices.php.

◆ getTitleFactory()

MediaWiki\MediaWikiServices::getTitleFactory ( )
Since
1.35

Definition at line 1906 of file MediaWikiServices.php.

◆ getTitleFormatter()

MediaWiki\MediaWikiServices::getTitleFormatter ( )
Since
1.28

Definition at line 1913 of file MediaWikiServices.php.

◆ getTitleMatcher()

MediaWiki\MediaWikiServices::getTitleMatcher ( )
Since
1.40

Definition at line 1920 of file MediaWikiServices.php.

◆ getTitleParser()

MediaWiki\MediaWikiServices::getTitleParser ( )
Since
1.28

Definition at line 1927 of file MediaWikiServices.php.

◆ getTrackingCategories()

MediaWiki\MediaWikiServices::getTrackingCategories ( )
Since
1.38

Definition at line 1934 of file MediaWikiServices.php.

◆ getUnblockUserFactory()

MediaWiki\MediaWikiServices::getUnblockUserFactory ( )
Since
1.36

Definition at line 1941 of file MediaWikiServices.php.

◆ getUndeletePageFactory()

MediaWiki\MediaWikiServices::getUndeletePageFactory ( )
Since
1.38

Definition at line 1948 of file MediaWikiServices.php.

◆ getUploadRevisionImporter()

MediaWiki\MediaWikiServices::getUploadRevisionImporter ( )
Since
1.32

Definition at line 1955 of file MediaWikiServices.php.

◆ getUrlUtils()

MediaWiki\MediaWikiServices::getUrlUtils ( )
Since
1.39

Definition at line 1962 of file MediaWikiServices.php.

◆ getUserCache()

MediaWiki\MediaWikiServices::getUserCache ( )
Since
1.36

Definition at line 1969 of file MediaWikiServices.php.

◆ getUserEditTracker()

MediaWiki\MediaWikiServices::getUserEditTracker ( )
Since
1.35

Definition at line 1976 of file MediaWikiServices.php.

◆ getUserFactory()

MediaWiki\MediaWikiServices::getUserFactory ( )
Since
1.35

Definition at line 1983 of file MediaWikiServices.php.

◆ getUserGroupManager()

MediaWiki\MediaWikiServices::getUserGroupManager ( )
Since
1.35

Definition at line 1990 of file MediaWikiServices.php.

◆ getUserGroupManagerFactory()

MediaWiki\MediaWikiServices::getUserGroupManagerFactory ( )
Since
1.35

Definition at line 1997 of file MediaWikiServices.php.

◆ getUserIdentityLookup()

MediaWiki\MediaWikiServices::getUserIdentityLookup ( )
Since
1.36

Definition at line 2004 of file MediaWikiServices.php.

◆ getUserIdentityUtils()

MediaWiki\MediaWikiServices::getUserIdentityUtils ( )
Since
1.41

Definition at line 2011 of file MediaWikiServices.php.

◆ getUserNamePrefixSearch()

MediaWiki\MediaWikiServices::getUserNamePrefixSearch ( )
Since
1.36

Definition at line 2018 of file MediaWikiServices.php.

◆ getUserNameUtils()

MediaWiki\MediaWikiServices::getUserNameUtils ( )
Since
1.35

Definition at line 2025 of file MediaWikiServices.php.

◆ getUserOptionsLookup()

MediaWiki\MediaWikiServices::getUserOptionsLookup ( )
Since
1.35

Definition at line 2032 of file MediaWikiServices.php.

◆ getUserOptionsManager()

MediaWiki\MediaWikiServices::getUserOptionsManager ( )
Since
1.35

Definition at line 2039 of file MediaWikiServices.php.

◆ getUserRegistrationLookup()

MediaWiki\MediaWikiServices::getUserRegistrationLookup ( )
Since
1.41

Definition at line 2046 of file MediaWikiServices.php.

◆ getWatchedItemQueryService()

MediaWiki\MediaWikiServices::getWatchedItemQueryService ( )
Since
1.28

Definition at line 2053 of file MediaWikiServices.php.

◆ getWatchedItemStore()

MediaWiki\MediaWikiServices::getWatchedItemStore ( )
Since
1.28

Definition at line 2060 of file MediaWikiServices.php.

◆ getWatchlistManager()

MediaWiki\MediaWikiServices::getWatchlistManager ( )
Since
1.36

Definition at line 2067 of file MediaWikiServices.php.

◆ getWikiExporterFactory()

MediaWiki\MediaWikiServices::getWikiExporterFactory ( )
Since
1.38

Definition at line 2074 of file MediaWikiServices.php.

◆ getWikiImporterFactory()

MediaWiki\MediaWikiServices::getWikiImporterFactory ( )
Since
1.37

Definition at line 2081 of file MediaWikiServices.php.

◆ getWikiPageFactory()

MediaWiki\MediaWikiServices::getWikiPageFactory ( )
Since
1.36

Definition at line 2088 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporter()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporter ( )
Since
1.31

Definition at line 2095 of file MediaWikiServices.php.

◆ getWikiRevisionOldRevisionImporterNoUpdates()

MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporterNoUpdates ( )
Since
1.31

Definition at line 2102 of file MediaWikiServices.php.

◆ getWikiRevisionUploadImporter()

MediaWiki\MediaWikiServices::getWikiRevisionUploadImporter ( )
Since
1.31

Definition at line 2109 of file MediaWikiServices.php.

◆ getWRStatsFactory()

MediaWiki\MediaWikiServices::getWRStatsFactory ( )
Since
1.39

Definition at line 2116 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 300 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 575 of file MediaWikiServices.php.

◆ newSearchEngine()

MediaWiki\MediaWikiServices::newSearchEngine ( )
Since
1.27

Definition at line 1758 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 591 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 411 of file MediaWikiServices.php.

References $runner.

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


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