Service locator for MediaWiki core services.
More...
|
static | allowGlobalInstance () |
| Allows a global service container instance to exist.
|
|
static | disableStorageBackend () |
| Disables all storage layer services.
|
|
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 (MediaWikiServices $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.
|
|
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 212 of file MediaWikiServices.php.
◆ __construct()
MediaWiki\MediaWikiServices::__construct |
( |
Config | $config | ) |
|
◆ 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 236 of file MediaWikiServices.php.
◆ 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. Use resetGlobalInstance() to restore normal operation.
- Since
- 1.28
- 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 468 of file MediaWikiServices.php.
Referenced by MediaWiki\Maintenance\MaintenanceRunner\run().
◆ 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 | $method | the name of the caller method, as given by METHOD. |
- Exceptions
-
- See also
- resetGlobalInstance()
-
forceGlobalInstance()
-
disableStorageBackend()
Definition at line 558 of file MediaWikiServices.php.
◆ forceGlobalInstance()
static MediaWiki\MediaWikiServices::forceGlobalInstance |
( |
MediaWikiServices | $services | ) |
|
|
static |
Replaces the global MediaWikiServices instance.
- Since
- 1.28
- Note
- This is for use in PHPUnit tests only!
- Exceptions
-
- Parameters
-
MediaWikiServices | $services | The new MediaWikiServices object. |
- Returns
- MediaWikiServices The old MediaWikiServices object, so it can be restored later.
Definition at line 317 of file MediaWikiServices.php.
◆ getActionFactory()
MediaWiki\MediaWikiServices::getActionFactory |
( |
| ) |
|
◆ getActorMigration()
MediaWiki\MediaWikiServices::getActorMigration |
( |
| ) |
|
◆ getActorNormalization()
MediaWiki\MediaWikiServices::getActorNormalization |
( |
| ) |
|
◆ getActorStore()
MediaWiki\MediaWikiServices::getActorStore |
( |
| ) |
|
◆ getActorStoreFactory()
MediaWiki\MediaWikiServices::getActorStoreFactory |
( |
| ) |
|
◆ getArchivedRevisionLookup()
MediaWiki\MediaWikiServices::getArchivedRevisionLookup |
( |
| ) |
|
◆ getAuthManager()
MediaWiki\MediaWikiServices::getAuthManager |
( |
| ) |
|
◆ getBacklinkCacheFactory()
MediaWiki\MediaWikiServices::getBacklinkCacheFactory |
( |
| ) |
|
◆ getBadFileLookup()
MediaWiki\MediaWikiServices::getBadFileLookup |
( |
| ) |
|
◆ getBlobStore()
MediaWiki\MediaWikiServices::getBlobStore |
( |
| ) |
|
◆ getBlobStoreFactory()
MediaWiki\MediaWikiServices::getBlobStoreFactory |
( |
| ) |
|
◆ getBlockActionInfo()
MediaWiki\MediaWikiServices::getBlockActionInfo |
( |
| ) |
|
◆ getBlockErrorFormatter()
MediaWiki\MediaWikiServices::getBlockErrorFormatter |
( |
| ) |
|
◆ getBlockManager()
MediaWiki\MediaWikiServices::getBlockManager |
( |
| ) |
|
◆ getBlockPermissionCheckerFactory()
MediaWiki\MediaWikiServices::getBlockPermissionCheckerFactory |
( |
| ) |
|
◆ getBlockRestrictionStore()
MediaWiki\MediaWikiServices::getBlockRestrictionStore |
( |
| ) |
|
◆ getBlockRestrictionStoreFactory()
MediaWiki\MediaWikiServices::getBlockRestrictionStoreFactory |
( |
| ) |
|
◆ getBlockUserFactory()
MediaWiki\MediaWikiServices::getBlockUserFactory |
( |
| ) |
|
◆ getBlockUtils()
MediaWiki\MediaWikiServices::getBlockUtils |
( |
| ) |
|
◆ 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
- Returns
- Config
Definition at line 750 of file MediaWikiServices.php.
◆ getBotPasswordStore()
MediaWiki\MediaWikiServices::getBotPasswordStore |
( |
| ) |
|
◆ getCentralIdLookup()
MediaWiki\MediaWikiServices::getCentralIdLookup |
( |
| ) |
|
◆ getCentralIdLookupFactory()
MediaWiki\MediaWikiServices::getCentralIdLookupFactory |
( |
| ) |
|
◆ getChangeTagDefStore()
MediaWiki\MediaWikiServices::getChangeTagDefStore |
( |
| ) |
|
◆ getCollationFactory()
MediaWiki\MediaWikiServices::getCollationFactory |
( |
| ) |
|
◆ getCommentFormatter()
MediaWiki\MediaWikiServices::getCommentFormatter |
( |
| ) |
|
◆ getCommentStore()
MediaWiki\MediaWikiServices::getCommentStore |
( |
| ) |
|
◆ getConfigFactory()
MediaWiki\MediaWikiServices::getConfigFactory |
( |
| ) |
|
◆ getConfigRepository()
MediaWiki\MediaWikiServices::getConfigRepository |
( |
| ) |
|
◆ getConfigSchema()
MediaWiki\MediaWikiServices::getConfigSchema |
( |
| ) |
|
◆ getConfiguredReadOnlyMode()
MediaWiki\MediaWikiServices::getConfiguredReadOnlyMode |
( |
| ) |
|
◆ getContentHandlerFactory()
MediaWiki\MediaWikiServices::getContentHandlerFactory |
( |
| ) |
|
◆ getContentLanguage()
MediaWiki\MediaWikiServices::getContentLanguage |
( |
| ) |
|
◆ getContentModelChangeFactory()
MediaWiki\MediaWikiServices::getContentModelChangeFactory |
( |
| ) |
|
◆ getContentModelStore()
MediaWiki\MediaWikiServices::getContentModelStore |
( |
| ) |
|
◆ getContentRenderer()
MediaWiki\MediaWikiServices::getContentRenderer |
( |
| ) |
|
◆ getContentTransformer()
MediaWiki\MediaWikiServices::getContentTransformer |
( |
| ) |
|
◆ getContributionsLookup()
MediaWiki\MediaWikiServices::getContributionsLookup |
( |
| ) |
|
◆ getCriticalSectionProvider()
MediaWiki\MediaWikiServices::getCriticalSectionProvider |
( |
| ) |
|
◆ getCryptHKDF()
MediaWiki\MediaWikiServices::getCryptHKDF |
( |
| ) |
|
◆ getDatabaseBlockStore()
MediaWiki\MediaWikiServices::getDatabaseBlockStore |
( |
| ) |
|
◆ getDatabaseFactory()
MediaWiki\MediaWikiServices::getDatabaseFactory |
( |
| ) |
|
◆ getDateFormatterFactory()
MediaWiki\MediaWikiServices::getDateFormatterFactory |
( |
| ) |
|
◆ getDBLoadBalancer()
MediaWiki\MediaWikiServices::getDBLoadBalancer |
( |
| ) |
|
- Since
- 1.28
- Returns
- ILoadBalancer The main DB load balancer for the local wiki.
Definition at line 942 of file MediaWikiServices.php.
◆ getDBLoadBalancerFactory()
MediaWiki\MediaWikiServices::getDBLoadBalancerFactory |
( |
| ) |
|
◆ getDBLoadBalancerFactoryConfigBuilder()
MediaWiki\MediaWikiServices::getDBLoadBalancerFactoryConfigBuilder |
( |
| ) |
|
◆ getDeletePageFactory()
MediaWiki\MediaWikiServices::getDeletePageFactory |
( |
| ) |
|
◆ getEmailer()
MediaWiki\MediaWikiServices::getEmailer |
( |
| ) |
|
◆ getEventRelayerGroup()
MediaWiki\MediaWikiServices::getEventRelayerGroup |
( |
| ) |
|
◆ getExternalStoreAccess()
MediaWiki\MediaWikiServices::getExternalStoreAccess |
( |
| ) |
|
◆ getExternalStoreFactory()
MediaWiki\MediaWikiServices::getExternalStoreFactory |
( |
| ) |
|
◆ getFileBackendGroup()
MediaWiki\MediaWikiServices::getFileBackendGroup |
( |
| ) |
|
◆ getGenderCache()
MediaWiki\MediaWikiServices::getGenderCache |
( |
| ) |
|
◆ getGlobalIdGenerator()
MediaWiki\MediaWikiServices::getGlobalIdGenerator |
( |
| ) |
|
◆ getGrantsInfo()
MediaWiki\MediaWikiServices::getGrantsInfo |
( |
| ) |
|
◆ getGrantsLocalization()
MediaWiki\MediaWikiServices::getGrantsLocalization |
( |
| ) |
|
◆ getGroupPermissionsLookup()
MediaWiki\MediaWikiServices::getGroupPermissionsLookup |
( |
| ) |
|
◆ getHookContainer()
MediaWiki\MediaWikiServices::getHookContainer |
( |
| ) |
|
◆ getHtmlCacheUpdater()
MediaWiki\MediaWikiServices::getHtmlCacheUpdater |
( |
| ) |
|
◆ getHTMLTransformFactory()
MediaWiki\MediaWikiServices::getHTMLTransformFactory |
( |
| ) |
|
◆ getHttpRequestFactory()
MediaWiki\MediaWikiServices::getHttpRequestFactory |
( |
| ) |
|
◆ 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!
- Returns
- MediaWikiServices
Definition at line 273 of file MediaWikiServices.php.
References wfDeprecatedMsg().
Referenced by MediaWiki\Session\SessionManager\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\ResourceLoader\ResourceLoader\__construct(), MediaWiki\Actions\FileDeleteAction\__construct(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\__construct(), MediaWiki\ResourceLoader\Context\__construct(), MediaWiki\ResourceLoader\MessageBlobStore\__construct(), MediaWiki\Preferences\DefaultPreferencesFactory\__construct(), MediaWiki\Session\SessionBackend\__construct(), MediaWiki\Session\PHPSessionHandler\__construct(), MediaWiki\EditPage\TextConflictHelper\__construct(), MediaWiki\EditPage\TextboxBuilder\buildTextboxAttribs(), MediaWiki\Block\DatabaseBlock\delete(), MediaWiki\Block\DatabaseBlock\doAutoblock(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), MediaWiki\ResourceLoader\FileModule\extractBasePaths(), MediaWiki\Search\SearchWidgets\FullSearchResultWidget\generateFileHtml(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), MediaWiki\Deferred\LinksUpdate\LinksTableGroup\get(), MediaWiki\ResourceLoader\WikiModule\getContent(), MediaWiki\ResourceLoader\WikiModule\getContentObj(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\ResourceLoader\Module\getFlip(), MediaWiki\Block\DatabaseBlock\getIpFragment(), MediaWiki\Rest\EntryPoint\getMainRequest(), MediaWiki\ResourceLoader\UserModule\getPages(), MediaWiki\ResourceLoader\UserStylesModule\getPages(), MediaWiki\Session\SessionManager\getProviders(), MediaWiki\ResourceLoader\UserOptionsModule\getScript(), MediaWiki\EditPage\TextboxBuilder\getTextboxProtectionCSSClasses(), MediaWiki\Block\DatabaseBlock\initFromRow(), MediaWiki\Block\DatabaseBlock\insert(), MediaWiki\Block\DatabaseBlock\isExemptedFromAutoblocks(), MediaWiki\Session\SessionManager\logPotentialSessionLeakage(), MediaWiki\Rest\EntryPoint\main(), MediaWiki\ResourceLoader\ResourceLoader\measureResponseTime(), MediaWiki\Session\UserInfo\newFromId(), MediaWiki\Session\UserInfo\newFromName(), MediaWiki\Block\DatabaseBlock\newLoad(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), MediaWiki\Rest\Handler\PageHTMLHandler\postValidationSetup(), MediaWiki\Rest\Handler\RevisionHTMLHandler\postValidationSetup(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable(), MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\render(), MediaWiki\Session\SessionBackend\save(), MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider\testUserForCreation(), and MediaWiki\Block\DatabaseBlock\update().
◆ getInterwikiLookup()
MediaWiki\MediaWikiServices::getInterwikiLookup |
( |
| ) |
|
◆ getJobQueueGroup()
MediaWiki\MediaWikiServices::getJobQueueGroup |
( |
| ) |
|
◆ getJobQueueGroupFactory()
MediaWiki\MediaWikiServices::getJobQueueGroupFactory |
( |
| ) |
|
◆ getJobRunner()
MediaWiki\MediaWikiServices::getJobRunner |
( |
| ) |
|
◆ getJsonCodec()
MediaWiki\MediaWikiServices::getJsonCodec |
( |
| ) |
|
◆ getLanguageConverterFactory()
MediaWiki\MediaWikiServices::getLanguageConverterFactory |
( |
| ) |
|
◆ getLanguageFactory()
MediaWiki\MediaWikiServices::getLanguageFactory |
( |
| ) |
|
◆ getLanguageFallback()
MediaWiki\MediaWikiServices::getLanguageFallback |
( |
| ) |
|
◆ getLanguageNameUtils()
MediaWiki\MediaWikiServices::getLanguageNameUtils |
( |
| ) |
|
◆ getLinkBatchFactory()
MediaWiki\MediaWikiServices::getLinkBatchFactory |
( |
| ) |
|
◆ getLinkCache()
MediaWiki\MediaWikiServices::getLinkCache |
( |
| ) |
|
◆ getLinkRenderer()
MediaWiki\MediaWikiServices::getLinkRenderer |
( |
| ) |
|
LinkRenderer instance that can be used if no custom options are needed.
- Since
- 1.28
- Returns
- LinkRenderer
Definition at line 1177 of file MediaWikiServices.php.
◆ getLinkRendererFactory()
MediaWiki\MediaWikiServices::getLinkRendererFactory |
( |
| ) |
|
◆ getLinksMigration()
MediaWiki\MediaWikiServices::getLinksMigration |
( |
| ) |
|
◆ getLinkTargetLookup()
MediaWiki\MediaWikiServices::getLinkTargetLookup |
( |
| ) |
|
◆ getLocalisationCache()
MediaWiki\MediaWikiServices::getLocalisationCache |
( |
| ) |
|
◆ 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
- Returns
- BagOStuff
Definition at line 1222 of file MediaWikiServices.php.
◆ getLockManagerGroupFactory()
MediaWiki\MediaWikiServices::getLockManagerGroupFactory |
( |
| ) |
|
◆ getMagicWordFactory()
MediaWiki\MediaWikiServices::getMagicWordFactory |
( |
| ) |
|
◆ 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
- Returns
- Config
Definition at line 1249 of file MediaWikiServices.php.
◆ getMainObjectStash()
MediaWiki\MediaWikiServices::getMainObjectStash |
( |
| ) |
|
◆ getMainWANObjectCache()
MediaWiki\MediaWikiServices::getMainWANObjectCache |
( |
| ) |
|
◆ getMediaHandlerFactory()
MediaWiki\MediaWikiServices::getMediaHandlerFactory |
( |
| ) |
|
◆ getMergeHistoryFactory()
MediaWiki\MediaWikiServices::getMergeHistoryFactory |
( |
| ) |
|
◆ getMessageCache()
MediaWiki\MediaWikiServices::getMessageCache |
( |
| ) |
|
◆ getMessageFormatterFactory()
MediaWiki\MediaWikiServices::getMessageFormatterFactory |
( |
| ) |
|
◆ getMetricsFactory()
MediaWiki\MediaWikiServices::getMetricsFactory |
( |
| ) |
|
◆ getMimeAnalyzer()
MediaWiki\MediaWikiServices::getMimeAnalyzer |
( |
| ) |
|
◆ getMovePageFactory()
MediaWiki\MediaWikiServices::getMovePageFactory |
( |
| ) |
|
◆ getNamespaceInfo()
MediaWiki\MediaWikiServices::getNamespaceInfo |
( |
| ) |
|
◆ getNameTableStoreFactory()
MediaWiki\MediaWikiServices::getNameTableStoreFactory |
( |
| ) |
|
◆ 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
- Returns
- ObjectFactory
Definition at line 1356 of file MediaWikiServices.php.
◆ getOldRevisionImporter()
MediaWiki\MediaWikiServices::getOldRevisionImporter |
( |
| ) |
|
◆ getPageEditStash()
MediaWiki\MediaWikiServices::getPageEditStash |
( |
| ) |
|
◆ getPageProps()
MediaWiki\MediaWikiServices::getPageProps |
( |
| ) |
|
◆ getPageStore()
MediaWiki\MediaWikiServices::getPageStore |
( |
| ) |
|
◆ getPageStoreFactory()
MediaWiki\MediaWikiServices::getPageStoreFactory |
( |
| ) |
|
◆ getPageUpdaterFactory()
MediaWiki\MediaWikiServices::getPageUpdaterFactory |
( |
| ) |
|
◆ 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.
- Since
- 1.29
- Returns
- Parser
Definition at line 1416 of file MediaWikiServices.php.
◆ getParserCache()
MediaWiki\MediaWikiServices::getParserCache |
( |
| ) |
|
◆ getParserCacheFactory()
MediaWiki\MediaWikiServices::getParserCacheFactory |
( |
| ) |
|
◆ getParserFactory()
MediaWiki\MediaWikiServices::getParserFactory |
( |
| ) |
|
◆ getParserOutputAccess()
MediaWiki\MediaWikiServices::getParserOutputAccess |
( |
| ) |
|
◆ getParsoidDataAccess()
MediaWiki\MediaWikiServices::getParsoidDataAccess |
( |
| ) |
|
◆ getParsoidOutputAccess()
MediaWiki\MediaWikiServices::getParsoidOutputAccess |
( |
| ) |
|
◆ getParsoidOutputStash()
MediaWiki\MediaWikiServices::getParsoidOutputStash |
( |
| ) |
|
- Returns
- ParsoidOutputStash
- Since
- 1.39
- Stability: unstable
- since 1.39, should be stable before release of 1.39
Definition at line 1474 of file MediaWikiServices.php.
◆ getParsoidPageConfigFactory()
MediaWiki\MediaWikiServices::getParsoidPageConfigFactory |
( |
| ) |
|
◆ getParsoidSiteConfig()
MediaWiki\MediaWikiServices::getParsoidSiteConfig |
( |
| ) |
|
◆ getPasswordFactory()
MediaWiki\MediaWikiServices::getPasswordFactory |
( |
| ) |
|
◆ getPasswordReset()
MediaWiki\MediaWikiServices::getPasswordReset |
( |
| ) |
|
◆ getPerDbNameStatsdDataFactory()
MediaWiki\MediaWikiServices::getPerDbNameStatsdDataFactory |
( |
| ) |
|
◆ getPermissionManager()
MediaWiki\MediaWikiServices::getPermissionManager |
( |
| ) |
|
◆ getPreferencesFactory()
MediaWiki\MediaWikiServices::getPreferencesFactory |
( |
| ) |
|
◆ getProxyLookup()
MediaWiki\MediaWikiServices::getProxyLookup |
( |
| ) |
|
◆ getRateLimiter()
MediaWiki\MediaWikiServices::getRateLimiter |
( |
| ) |
|
◆ getReadOnlyMode()
MediaWiki\MediaWikiServices::getReadOnlyMode |
( |
| ) |
|
◆ getRedirectLookup()
MediaWiki\MediaWikiServices::getRedirectLookup |
( |
| ) |
|
◆ getRedirectStore()
MediaWiki\MediaWikiServices::getRedirectStore |
( |
| ) |
|
◆ getRepoGroup()
MediaWiki\MediaWikiServices::getRepoGroup |
( |
| ) |
|
◆ getResourceLoader()
MediaWiki\MediaWikiServices::getResourceLoader |
( |
| ) |
|
◆ getRestrictionStore()
MediaWiki\MediaWikiServices::getRestrictionStore |
( |
| ) |
|
◆ getRevertedTagUpdateManager()
MediaWiki\MediaWikiServices::getRevertedTagUpdateManager |
( |
| ) |
|
◆ getRevisionFactory()
MediaWiki\MediaWikiServices::getRevisionFactory |
( |
| ) |
|
◆ getRevisionLookup()
MediaWiki\MediaWikiServices::getRevisionLookup |
( |
| ) |
|
◆ getRevisionRenderer()
MediaWiki\MediaWikiServices::getRevisionRenderer |
( |
| ) |
|
◆ getRevisionStore()
MediaWiki\MediaWikiServices::getRevisionStore |
( |
| ) |
|
◆ getRevisionStoreFactory()
MediaWiki\MediaWikiServices::getRevisionStoreFactory |
( |
| ) |
|
◆ getRollbackPageFactory()
MediaWiki\MediaWikiServices::getRollbackPageFactory |
( |
| ) |
|
◆ getRowCommentFormatter()
MediaWiki\MediaWikiServices::getRowCommentFormatter |
( |
| ) |
|
◆ getSearchEngineConfig()
MediaWiki\MediaWikiServices::getSearchEngineConfig |
( |
| ) |
|
◆ getSearchEngineFactory()
MediaWiki\MediaWikiServices::getSearchEngineFactory |
( |
| ) |
|
◆ getService()
MediaWiki\MediaWikiServices::getService |
( |
| $name | ) |
|
◆ getShellboxClientFactory()
MediaWiki\MediaWikiServices::getShellboxClientFactory |
( |
| ) |
|
◆ getShellCommandFactory()
MediaWiki\MediaWikiServices::getShellCommandFactory |
( |
| ) |
|
◆ getSignatureValidatorFactory()
MediaWiki\MediaWikiServices::getSignatureValidatorFactory |
( |
| ) |
|
◆ getSiteLookup()
MediaWiki\MediaWikiServices::getSiteLookup |
( |
| ) |
|
◆ getSiteStore()
MediaWiki\MediaWikiServices::getSiteStore |
( |
| ) |
|
◆ getSkinFactory()
MediaWiki\MediaWikiServices::getSkinFactory |
( |
| ) |
|
◆ getSlotRoleRegistry()
MediaWiki\MediaWikiServices::getSlotRoleRegistry |
( |
| ) |
|
◆ getSlotRoleStore()
MediaWiki\MediaWikiServices::getSlotRoleStore |
( |
| ) |
|
◆ getSpamChecker()
MediaWiki\MediaWikiServices::getSpamChecker |
( |
| ) |
|
◆ getSpecialPageFactory()
MediaWiki\MediaWikiServices::getSpecialPageFactory |
( |
| ) |
|
◆ getStatsdDataFactory()
MediaWiki\MediaWikiServices::getStatsdDataFactory |
( |
| ) |
|
◆ getTalkPageNotificationManager()
MediaWiki\MediaWikiServices::getTalkPageNotificationManager |
( |
| ) |
|
◆ getTempFSFileFactory()
MediaWiki\MediaWikiServices::getTempFSFileFactory |
( |
| ) |
|
◆ getTempUserConfig()
MediaWiki\MediaWikiServices::getTempUserConfig |
( |
| ) |
|
◆ getTempUserCreator()
MediaWiki\MediaWikiServices::getTempUserCreator |
( |
| ) |
|
◆ getTidy()
MediaWiki\MediaWikiServices::getTidy |
( |
| ) |
|
◆ getTitleFactory()
MediaWiki\MediaWikiServices::getTitleFactory |
( |
| ) |
|
◆ getTitleFormatter()
MediaWiki\MediaWikiServices::getTitleFormatter |
( |
| ) |
|
◆ getTitleParser()
MediaWiki\MediaWikiServices::getTitleParser |
( |
| ) |
|
◆ getTrackingCategories()
MediaWiki\MediaWikiServices::getTrackingCategories |
( |
| ) |
|
◆ getUnblockUserFactory()
MediaWiki\MediaWikiServices::getUnblockUserFactory |
( |
| ) |
|
◆ getUndeletePageFactory()
MediaWiki\MediaWikiServices::getUndeletePageFactory |
( |
| ) |
|
◆ getUploadRevisionImporter()
MediaWiki\MediaWikiServices::getUploadRevisionImporter |
( |
| ) |
|
◆ getUrlUtils()
MediaWiki\MediaWikiServices::getUrlUtils |
( |
| ) |
|
◆ getUserCache()
MediaWiki\MediaWikiServices::getUserCache |
( |
| ) |
|
◆ getUserEditTracker()
MediaWiki\MediaWikiServices::getUserEditTracker |
( |
| ) |
|
◆ getUserFactory()
MediaWiki\MediaWikiServices::getUserFactory |
( |
| ) |
|
◆ getUserGroupManager()
MediaWiki\MediaWikiServices::getUserGroupManager |
( |
| ) |
|
◆ getUserGroupManagerFactory()
MediaWiki\MediaWikiServices::getUserGroupManagerFactory |
( |
| ) |
|
◆ getUserIdentityLookup()
MediaWiki\MediaWikiServices::getUserIdentityLookup |
( |
| ) |
|
◆ getUserNamePrefixSearch()
MediaWiki\MediaWikiServices::getUserNamePrefixSearch |
( |
| ) |
|
◆ getUserNameUtils()
MediaWiki\MediaWikiServices::getUserNameUtils |
( |
| ) |
|
◆ getUserOptionsLookup()
MediaWiki\MediaWikiServices::getUserOptionsLookup |
( |
| ) |
|
◆ getUserOptionsManager()
MediaWiki\MediaWikiServices::getUserOptionsManager |
( |
| ) |
|
◆ getVirtualRESTServiceClient()
MediaWiki\MediaWikiServices::getVirtualRESTServiceClient |
( |
| ) |
|
◆ getWatchedItemQueryService()
MediaWiki\MediaWikiServices::getWatchedItemQueryService |
( |
| ) |
|
◆ getWatchedItemStore()
MediaWiki\MediaWikiServices::getWatchedItemStore |
( |
| ) |
|
◆ getWatchlistManager()
MediaWiki\MediaWikiServices::getWatchlistManager |
( |
| ) |
|
◆ getWatchlistNotificationManager()
MediaWiki\MediaWikiServices::getWatchlistNotificationManager |
( |
| ) |
|
◆ getWikiExporterFactory()
MediaWiki\MediaWikiServices::getWikiExporterFactory |
( |
| ) |
|
◆ getWikiImporterFactory()
MediaWiki\MediaWikiServices::getWikiImporterFactory |
( |
| ) |
|
◆ getWikiPageFactory()
MediaWiki\MediaWikiServices::getWikiPageFactory |
( |
| ) |
|
◆ getWikiRevisionOldRevisionImporter()
MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporter |
( |
| ) |
|
◆ getWikiRevisionOldRevisionImporterNoUpdates()
MediaWiki\MediaWikiServices::getWikiRevisionOldRevisionImporterNoUpdates |
( |
| ) |
|
◆ getWikiRevisionUploadImporter()
MediaWiki\MediaWikiServices::getWikiRevisionUploadImporter |
( |
| ) |
|
◆ getWRStatsFactory()
MediaWiki\MediaWikiServices::getWRStatsFactory |
( |
| ) |
|
◆ 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.
- Returns
- bool
Definition at line 253 of file MediaWikiServices.php.
◆ newSearchEngine()
MediaWiki\MediaWikiServices::newSearchEngine |
( |
| ) |
|
◆ 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()
-
disableStorageBackend()
Definition at line 492 of file MediaWikiServices.php.
◆ 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.
-
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 | $bootstrapConfig | The 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 | $quick | Set this to "quick" to allow expensive resources to be re-used. See SalvageableService for details. |
- Exceptions
-
MWException | If 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). |
Definition at line 367 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 | $destroy | Whether the service instance should be destroyed if it exists. When set to false, any existing service instance will effectively be detached from the container. |
- Exceptions
-
Definition at line 523 of file MediaWikiServices.php.
The documentation for this class was generated from the following file: