Service locator for MediaWiki core services.
More...
Inherits ServiceContainer.
|
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 223 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 253 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 494 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 474 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 | $method | the name of the caller method, as given by METHOD. |
- See also
- resetGlobalInstance()
-
forceGlobalInstance()
-
disableStorage()
Definition at line 629 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!
- Parameters
-
MediaWikiServices | $services | The new MediaWikiServices object. |
- Returns
- MediaWikiServices The old MediaWikiServices object, so it can be restored later.
Definition at line 332 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 821 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 |
( |
| ) |
|
◆ getDatabaseBlockStoreFactory()
MediaWiki\MediaWikiServices::getDatabaseBlockStoreFactory |
( |
| ) |
|
◆ 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 1021 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 290 of file MediaWikiServices.php.
References wfDeprecatedMsg().
Referenced by MediaWiki\Site\MediaWikiPageNameNormalizer\__construct(), MediaWiki\Parser\MagicWord\__construct(), MediaWiki\Parser\MagicWordArray\__construct(), MediaWiki\RenameUser\RenameuserSQL\__construct(), MediaWiki\Session\SessionManager\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\EditPage\EditPage\__construct(), MediaWiki\Page\ProtectionForm\__construct(), MediaWiki\Actions\FileDeleteAction\__construct(), MediaWiki\ResourceLoader\ResourceLoader\__construct(), MediaWiki\Category\CategoryViewer\__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\Specials\SpecialUserRights\__construct(), MediaWiki\Category\CategoryViewer\addSubcategoryObject(), MediaWiki\EditPage\TextboxBuilder\buildTextboxAttribs(), MediaWiki\Html\Html\buttonAttributes(), MediaWiki\Feed\FeedUtils\checkFeedOutput(), MediaWiki\Linker\Linker\commentBlock(), MediaWiki\Block\DatabaseBlock\delete(), MediaWiki\Block\DatabaseBlock\doAutoblock(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\doIncrementalUpdate(), MediaWiki\EditPage\EditPage\edit(), MediaWiki\ResourceLoader\FileModule\extractBasePaths(), MediaWiki\Linker\Linker\formatComment(), MediaWiki\Feed\FeedUtils\formatDiff(), MediaWiki\Feed\FeedUtils\formatDiffRow(), MediaWiki\Feed\FeedUtils\formatDiffRow2(), MediaWiki\Linker\Linker\formatLinksInComment(), MediaWiki\Deferred\LinksUpdate\LinksTableGroup\get(), MediaWiki\WikiMap\WikiMap\getCanonicalServerInfoForAllWikis(), MediaWiki\ResourceLoader\WikiModule\getContent(), MediaWiki\ResourceLoader\WikiModule\getContentObj(), MediaWiki\Request\FauxRequest\getCookie(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\ResourceLoader\Module\getFlip(), MediaWiki\Linker\Linker\getImageLinkMTOParams(), MediaWiki\Linker\Linker\getInvalidTitleDescription(), MediaWiki\Block\DatabaseBlock\getIpFragment(), MediaWiki\Feed\FeedItem\getLanguage(), MediaWiki\Rest\EntryPoint\getMainRequest(), MediaWiki\Request\WebRequestUpload\getName(), MediaWiki\ResourceLoader\UserModule\getPages(), MediaWiki\ResourceLoader\UserStylesModule\getPages(), MediaWiki\Mail\EmailUser\getPermissionsError(), MediaWiki\ExternalLinks\LinkFilter\getProtocolPrefix(), MediaWiki\Session\SessionManager\getProviders(), MediaWiki\Block\DatabaseBlock\getQueryInfo(), MediaWiki\ResourceLoader\UserOptionsModule\getScript(), MediaWiki\CommentStore\CommentStore\getStore(), MediaWiki\Html\TemplateParser\getTemplate(), MediaWiki\EditPage\TextboxBuilder\getTextboxProtectionCSSClasses(), MediaWiki\Html\Html\getTextInputAttributes(), MediaWiki\Linker\Linker\getUploadUrl(), MediaWiki\Html\Html\htmlHeader(), MediaWiki\Feed\ChannelFeed\httpHeaders(), MediaWiki\Block\DatabaseBlock\initFromRow(), MediaWiki\Html\Html\inlineScript(), MediaWiki\Block\DatabaseBlock\insert(), MediaWiki\Block\DatabaseBlock\isExemptedFromAutoblocks(), MediaWiki\Linker\Linker\link(), MediaWiki\Html\Html\linkedScript(), MediaWiki\Session\SessionManager\logPotentialSessionLeakage(), MediaWiki\Rest\EntryPoint\main(), MediaWiki\Linker\Linker\makeBrokenImageLinkObj(), MediaWiki\Linker\Linker\makeImageLink(), MediaWiki\Linker\Linker\makeMediaLinkObj(), MediaWiki\Linker\Linker\makeThumbLink2(), MediaWiki\ResourceLoader\ResourceLoader\measureResponseTime(), MediaWiki\Html\Html\namespaceSelectorOptions(), MediaWiki\Session\UserInfo\newFromId(), MediaWiki\Session\UserInfo\newFromName(), MediaWiki\Block\DatabaseBlock\newLoad(), MediaWiki\User\ActorMigration\newMigration(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), MediaWiki\CommentStore\CommentStoreComment\newUnsavedComment(), MediaWiki\Linker\Linker\normalizeSubpageLink(), MediaWiki\Feed\AtomFeed\outItem(), MediaWiki\Rest\Handler\PageHTMLHandler\postValidationSetup(), MediaWiki\Rest\Handler\RevisionHTMLHandler\postValidationSetup(), MediaWiki\ExternalLinks\LinkFilter\prepareProtocols(), MediaWiki\Linker\Linker\processResponsiveImages(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs(), MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable(), MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\render(), MediaWiki\Linker\Linker\revComment(), MediaWiki\Session\SessionBackend\save(), MediaWiki\Request\WebResponse\setCookie(), MediaWiki\Request\FauxRequest\setCookies(), MediaWiki\Mail\EmailUser\submit(), MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider\testUserForCreation(), MediaWiki\Block\DatabaseBlock\update(), MediaWiki\Linker\Linker\userLink(), MediaWiki\Linker\Linker\userToolLinks(), and MediaWiki\Mail\EmailUser\validateTarget().
◆ getInterwikiLookup()
MediaWiki\MediaWikiServices::getInterwikiLookup |
( |
| ) |
|
◆ getJobFactory()
MediaWiki\MediaWikiServices::getJobFactory |
( |
| ) |
|
◆ 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 1264 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 1309 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 1336 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 |
( |
| ) |
|
◆ 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 1435 of file MediaWikiServices.php.
◆ getOldRevisionImporter()
MediaWiki\MediaWikiServices::getOldRevisionImporter |
( |
| ) |
|
◆ getPageEditStash()
MediaWiki\MediaWikiServices::getPageEditStash |
( |
| ) |
|
◆ getPageProps()
MediaWiki\MediaWikiServices::getPageProps |
( |
| ) |
|
◆ getPageRestHelperFactory()
MediaWiki\MediaWikiServices::getPageRestHelperFactory |
( |
| ) |
|
◆ 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 1503 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 1562 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 |
( |
| ) |
|
◆ getPoolCounterFactory()
MediaWiki\MediaWikiServices::getPoolCounterFactory |
( |
| ) |
|
◆ 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 |
( |
| ) |
|
◆ getSearchResultThumbnailProvider()
MediaWiki\MediaWikiServices::getSearchResultThumbnailProvider |
( |
| ) |
|
◆ 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 |
( |
| ) |
|
◆ getStatsCache()
MediaWiki\MediaWikiServices::getStatsCache |
( |
| ) |
|
◆ getStatsdDataFactory()
MediaWiki\MediaWikiServices::getStatsdDataFactory |
( |
| ) |
|
◆ getStatsFactory()
MediaWiki\MediaWikiServices::getStatsFactory |
( |
| ) |
|
◆ 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 |
( |
| ) |
|
◆ getTitleMatcher()
MediaWiki\MediaWikiServices::getTitleMatcher |
( |
| ) |
|
◆ 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 |
◆ isStorageDisabled()
MediaWiki\MediaWikiServices::isStorageDisabled |
( |
| ) |
|
Returns true if disableStorage() has been called on this MediaWikiServices instance.
- Returns
- bool
Definition at line 551 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()
-
disableStorage()
Definition at line 567 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 | $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. |
Definition at line 380 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. |
Definition at line 596 of file MediaWikiServices.php.
The documentation for this class was generated from the following file: