MediaWiki  master
MediaWikiServices.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki;
4 
6 use BagOStuff;
7 use CommentStore;
8 use Config;
9 use ConfigFactory;
11 use CryptHKDF;
17 use GenderCache;
18 use GlobalVarConfig;
19 use Hooks;
21 use Language;
22 use LinkCache;
23 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
57 use MessageCache;
58 use MimeAnalyzer;
59 use MWException;
60 use NamespaceInfo;
61 use ObjectCache;
63 use Parser;
64 use ParserCache;
65 use ParserFactory;
66 use PasswordFactory;
67 use PasswordReset;
68 use ProxyLookup;
69 use ReadOnlyMode;
70 use RepoGroup;
71 use ResourceLoader;
72 use SearchEngine;
75 use SiteLookup;
76 use SiteStore;
77 use SkinFactory;
78 use TitleFactory;
79 use TitleFormatter;
80 use TitleParser;
83 use WANObjectCache;
87 use Wikimedia\ObjectFactory;
93 
130 class MediaWikiServices extends ServiceContainer {
131 
135  private static $instance = null;
136 
143  public static function hasInstance() {
144  return self::$instance !== null;
145  }
146 
161  public static function getInstance() {
162  if ( self::$instance === null ) {
163  // NOTE: constructing GlobalVarConfig here is not particularly pretty,
164  // but some information from the global scope has to be injected here,
165  // even if it's just a file name or database credentials to load
166  // configuration from.
167  $bootstrapConfig = new GlobalVarConfig();
168  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
169  }
170 
171  return self::$instance;
172  }
173 
187  public static function forceGlobalInstance( MediaWikiServices $services ) {
188  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
189  throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
190  }
191 
192  $old = self::getInstance();
193  self::$instance = $services;
194 
195  return $old;
196  }
197 
237  public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
238  if ( self::$instance === null ) {
239  // no global instance yet, nothing to reset
240  return;
241  }
242 
243  self::failIfResetNotAllowed( __METHOD__ );
244 
245  if ( $bootstrapConfig === null ) {
246  $bootstrapConfig = self::$instance->getBootstrapConfig();
247  }
248 
249  $oldInstance = self::$instance;
250 
251  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
252  self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
253 
254  if ( $quick === 'quick' ) {
255  self::$instance->salvage( $oldInstance );
256  } else {
257  $oldInstance->destroy();
258  }
259  }
260 
270  private function salvage( self $other ) {
271  foreach ( $this->getServiceNames() as $name ) {
272  // The service could be new in the new instance and not registered in the
273  // other instance (e.g. an extension that was loaded after the instantiation of
274  // the other instance. Skip this service in this case. See T143974
275  try {
276  $oldService = $other->peekService( $name );
277  } catch ( NoSuchServiceException $e ) {
278  continue;
279  }
280 
281  if ( $oldService instanceof SalvageableService ) {
283  $newService = $this->getService( $name );
284  $newService->salvage( $oldService );
285  }
286  }
287 
288  $other->destroy();
289  }
290 
306  private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
307  $instance = new self( $bootstrapConfig );
308 
309  // Load the default wiring from the specified files.
310  if ( $loadWiring === 'load' ) {
311  $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
312  $instance->loadWiringFiles( $wiringFiles );
313  }
314 
315  // Provide a traditional hook point to allow extensions to configure services.
316  Hooks::run( 'MediaWikiServices', [ $instance ] );
317 
318  return $instance;
319  }
320 
336  public static function disableStorageBackend() {
337  // TODO: also disable some Caches, JobQueues, etc
338  $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
339  $services = self::getInstance();
340 
341  foreach ( $destroy as $name ) {
342  $services->disableService( $name );
343  }
344 
346  }
347 
360  public static function resetChildProcessServices() {
361  // NOTE: for now, just reset everything. Since we don't know the interdependencies
362  // between services, we can't do this more selectively at this time.
363  self::resetGlobalInstance();
364 
365  // Child, reseed because there is no bug in PHP:
366  // https://bugs.php.net/bug.php?id=42465
367  mt_srand( getmypid() );
368  }
369 
391  public function resetServiceForTesting( $name, $destroy = true ) {
392  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
393  throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
394  }
395 
396  $this->resetService( $name, $destroy );
397  }
398 
426  public static function failIfResetNotAllowed( $method ) {
427  if ( !defined( 'MW_PHPUNIT_TEST' )
428  && !defined( 'MW_PARSER_TEST' )
429  && !defined( 'MEDIAWIKI_INSTALL' )
430  && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
431  && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
432  ) {
433  throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
434  }
435  }
436 
442  public function __construct( Config $config ) {
443  parent::__construct();
444 
445  // Register the given Config object as the bootstrap config service.
446  $this->defineService( 'BootstrapConfig', function () use ( $config ) {
447  return $config;
448  } );
449  }
450 
451  // CONVENIENCE GETTERS ////////////////////////////////////////////////////
452 
457  public function getActorMigration() : ActorMigration {
458  return $this->getService( 'ActorMigration' );
459  }
460 
465  public function getBadFileLookup() : BadFileLookup {
466  return $this->getService( 'BadFileLookup' );
467  }
468 
473  public function getBlobStore() : BlobStore {
474  return $this->getService( '_SqlBlobStore' );
475  }
476 
481  public function getBlobStoreFactory() : BlobStoreFactory {
482  return $this->getService( 'BlobStoreFactory' );
483  }
484 
489  public function getBlockErrorFormatter() : BlockErrorFormatter {
490  return $this->getService( 'BlockErrorFormatter' );
491  }
492 
497  public function getBlockManager() : BlockManager {
498  return $this->getService( 'BlockManager' );
499  }
500 
505  public function getBlockRestrictionStore() : BlockRestrictionStore {
506  return $this->getService( 'BlockRestrictionStore' );
507  }
508 
522  public function getBootstrapConfig() : Config {
523  return $this->getService( 'BootstrapConfig' );
524  }
525 
530  public function getChangeTagDefStore() : NameTableStore {
531  return $this->getService( 'NameTableStoreFactory' )->getChangeTagDef();
532  }
533 
538  public function getCommentStore() : CommentStore {
539  return $this->getService( 'CommentStore' );
540  }
541 
546  public function getConfigFactory() : ConfigFactory {
547  return $this->getService( 'ConfigFactory' );
548  }
549 
554  public function getConfigRepository() : ConfigRepository {
555  return $this->getService( 'ConfigRepository' );
556  }
557 
563  return $this->getService( 'ConfiguredReadOnlyMode' );
564  }
565 
570  public function getContentLanguage() : \Language {
571  return $this->getService( 'ContentLanguage' );
572  }
573 
578  public function getContentModelStore() : NameTableStore {
579  return $this->getService( 'NameTableStoreFactory' )->getContentModels();
580  }
581 
586  public function getCryptHKDF() : CryptHKDF {
587  return $this->getService( 'CryptHKDF' );
588  }
589 
595  return $this->getService( 'DateFormatterFactory' );
596  }
597 
602  public function getDBLoadBalancer() : ILoadBalancer {
603  return $this->getService( 'DBLoadBalancer' );
604  }
605 
610  public function getDBLoadBalancerFactory() : LBFactory {
611  return $this->getService( 'DBLoadBalancerFactory' );
612  }
613 
619  return $this->getService( 'EventRelayerGroup' );
620  }
621 
627  return $this->getService( 'ExternalStoreAccess' );
628  }
629 
635  return $this->getService( 'ExternalStoreFactory' );
636  }
637 
642  public function getFileBackendGroup() : FileBackendGroup {
643  return $this->getService( 'FileBackendGroup' );
644  }
645 
650  public function getGenderCache() : GenderCache {
651  return $this->getService( 'GenderCache' );
652  }
653 
658  public function getHttpRequestFactory() : HttpRequestFactory {
659  return $this->getService( 'HttpRequestFactory' );
660  }
661 
666  public function getInterwikiLookup() : InterwikiLookup {
667  return $this->getService( 'InterwikiLookup' );
668  }
669 
674  public function getLanguageFactory() : LanguageFactory {
675  return $this->getService( 'LanguageFactory' );
676  }
677 
682  public function getLanguageFallback() : LanguageFallback {
683  return $this->getService( 'LanguageFallback' );
684  }
685 
690  public function getLanguageNameUtils() {
691  return $this->getService( 'LanguageNameUtils' );
692  }
693 
698  public function getLinkBatchFactory() : LinkBatchFactory {
699  return $this->getService( 'LinkBatchFactory' );
700  }
701 
706  public function getLinkCache() : LinkCache {
707  return $this->getService( 'LinkCache' );
708  }
709 
717  public function getLinkRenderer() : LinkRenderer {
718  return $this->getService( 'LinkRenderer' );
719  }
720 
725  public function getLinkRendererFactory() : LinkRendererFactory {
726  return $this->getService( 'LinkRendererFactory' );
727  }
728 
734  return $this->getService( 'LocalisationCache' );
735  }
736 
741  public function getLocalServerObjectCache() : \BagOStuff {
742  return $this->getService( 'LocalServerObjectCache' );
743  }
744 
749  public function getLockManagerGroupFactory() : LockManagerGroupFactory {
750  return $this->getService( 'LockManagerGroupFactory' );
751  }
752 
757  public function getMagicWordFactory() : MagicWordFactory {
758  return $this->getService( 'MagicWordFactory' );
759  }
760 
768  public function getMainConfig() : Config {
769  return $this->getService( 'MainConfig' );
770  }
771 
776  public function getMainObjectStash() : \BagOStuff {
777  return $this->getService( 'MainObjectStash' );
778  }
779 
784  public function getMainWANObjectCache() : \WANObjectCache {
785  return $this->getService( 'MainWANObjectCache' );
786  }
787 
793  return $this->getService( 'MediaHandlerFactory' );
794  }
795 
800  public function getMessageCache() : MessageCache {
801  return $this->getService( 'MessageCache' );
802  }
803 
808  public function getMessageFormatterFactory() : IMessageFormatterFactory {
809  return $this->getService( 'MessageFormatterFactory' );
810  }
811 
816  public function getMimeAnalyzer() : MimeAnalyzer {
817  return $this->getService( 'MimeAnalyzer' );
818  }
819 
824  public function getMovePageFactory() : MovePageFactory {
825  return $this->getService( 'MovePageFactory' );
826  }
827 
832  public function getNamespaceInfo() : NamespaceInfo {
833  return $this->getService( 'NamespaceInfo' );
834  }
835 
840  public function getNameTableStoreFactory() : NameTableStoreFactory {
841  return $this->getService( 'NameTableStoreFactory' );
842  }
843 
851  public function getObjectFactory() : ObjectFactory {
852  return $this->getService( 'ObjectFactory' );
853  }
854 
860  return $this->getService( 'OldRevisionImporter' );
861  }
862 
867  public function getPageEditStash() : PageEditStash {
868  return $this->getService( 'PageEditStash' );
869  }
870 
875  public function getParser() : Parser {
876  return $this->getService( 'Parser' );
877  }
878 
883  public function getParserCache() : ParserCache {
884  return $this->getService( 'ParserCache' );
885  }
886 
891  public function getParserFactory() : ParserFactory {
892  return $this->getService( 'ParserFactory' );
893  }
894 
899  public function getPasswordFactory() : PasswordFactory {
900  return $this->getService( 'PasswordFactory' );
901  }
902 
907  public function getPasswordReset() : PasswordReset {
908  return $this->getService( 'PasswordReset' );
909  }
910 
915  public function getPerDbNameStatsdDataFactory() : StatsdDataFactoryInterface {
916  return $this->getService( 'PerDbNameStatsdDataFactory' );
917  }
918 
923  public function getPermissionManager() : PermissionManager {
924  return $this->getService( 'PermissionManager' );
925  }
926 
931  public function getPreferencesFactory() : PreferencesFactory {
932  return $this->getService( 'PreferencesFactory' );
933  }
934 
939  public function getProxyLookup() : ProxyLookup {
940  return $this->getService( 'ProxyLookup' );
941  }
942 
947  public function getReadOnlyMode() : \ReadOnlyMode {
948  return $this->getService( 'ReadOnlyMode' );
949  }
950 
955  public function getRepoGroup() : RepoGroup {
956  return $this->getService( 'RepoGroup' );
957  }
958 
963  public function getResourceLoader() : ResourceLoader {
964  return $this->getService( 'ResourceLoader' );
965  }
966 
971  public function getRevisionFactory() : RevisionFactory {
972  return $this->getService( 'RevisionFactory' );
973  }
974 
979  public function getRevisionLookup() : RevisionLookup {
980  return $this->getService( 'RevisionLookup' );
981  }
982 
987  public function getRevisionRenderer() : RevisionRenderer {
988  return $this->getService( 'RevisionRenderer' );
989  }
990 
995  public function getRevisionStore() : RevisionStore {
996  return $this->getService( 'RevisionStore' );
997  }
998 
1003  public function getRevisionStoreFactory() : RevisionStoreFactory {
1004  return $this->getService( 'RevisionStoreFactory' );
1005  }
1006 
1011  public function newSearchEngine() : SearchEngine {
1012  // New engine object every time, since they keep state
1013  return $this->getService( 'SearchEngineFactory' )->create();
1014  }
1015 
1021  return $this->getService( 'SearchEngineConfig' );
1022  }
1023 
1029  return $this->getService( 'SearchEngineFactory' );
1030  }
1031 
1036  public function getShellCommandFactory() : CommandFactory {
1037  return $this->getService( 'ShellCommandFactory' );
1038  }
1039 
1044  public function getSiteLookup() : SiteLookup {
1045  return $this->getService( 'SiteLookup' );
1046  }
1047 
1052  public function getSiteStore() : SiteStore {
1053  return $this->getService( 'SiteStore' );
1054  }
1055 
1060  public function getSkinFactory() : SkinFactory {
1061  return $this->getService( 'SkinFactory' );
1062  }
1063 
1068  public function getSlotRoleRegistry() : SlotRoleRegistry {
1069  return $this->getService( 'SlotRoleRegistry' );
1070  }
1071 
1076  public function getSlotRoleStore() : NameTableStore {
1077  return $this->getService( 'NameTableStoreFactory' )->getSlotRoles();
1078  }
1079 
1085  return $this->getService( 'SpecialPageFactory' );
1086  }
1087 
1093  return $this->getService( 'StatsdDataFactory' );
1094  }
1095 
1100  public function getTempFSFileFactory() : TempFSFileFactory {
1101  return $this->getService( 'TempFSFileFactory' );
1102  }
1103 
1108  public function getTitleFactory() : TitleFactory {
1109  return $this->getService( 'TitleFactory' );
1110  }
1111 
1116  public function getTitleFormatter() : TitleFormatter {
1117  return $this->getService( 'TitleFormatter' );
1118  }
1119 
1124  public function getTitleParser() : TitleParser {
1125  return $this->getService( 'TitleParser' );
1126  }
1127 
1133  return $this->getService( 'UploadRevisionImporter' );
1134  }
1135 
1141  return $this->getService( 'VirtualRESTServiceClient' );
1142  }
1143 
1149  return $this->getService( 'WatchedItemQueryService' );
1150  }
1151 
1157  return $this->getService( 'WatchedItemStore' );
1158  }
1159 
1165  return $this->getService( 'OldRevisionImporter' );
1166  }
1167 
1173  return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
1174  }
1175 
1181  return $this->getService( 'UploadRevisionImporter' );
1182  }
1183 
1184 }
EventRelayerGroup
Factory class for spawning EventRelayer objects using configuration.
Definition: EventRelayerGroup.php:26
MediaWiki\MediaWikiServices\getMessageCache
getMessageCache()
Definition: MediaWikiServices.php:800
MediaWiki\MediaWikiServices\getBlockErrorFormatter
getBlockErrorFormatter()
Definition: MediaWikiServices.php:489
ObjectCache\clear
static clear()
Clear all the cached instances.
Definition: ObjectCache.php:276
ObjectCache
Functions to get cache objects.
Definition: ObjectCache.php:68
LinkCache
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition: LinkCache.php:34
MediaWiki\MediaWikiServices\getShellCommandFactory
getShellCommandFactory()
Definition: MediaWikiServices.php:1036
SpecialPageFactory
Wrapper for backward compatibility for old callers that used static methods.
Definition: SpecialPageFactory_deprecated.php:34
MediaWiki\MediaWikiServices\getInterwikiLookup
getInterwikiLookup()
Definition: MediaWikiServices.php:666
MediaWiki\MediaWikiServices\getResourceLoader
getResourceLoader()
Definition: MediaWikiServices.php:963
MediaWiki\MediaWikiServices\getSearchEngineConfig
getSearchEngineConfig()
Definition: MediaWikiServices.php:1020
UploadRevisionImporter
Definition: UploadRevisionImporter.php:6
FileBackendGroup
Class to handle file backend registration.
Definition: FileBackendGroup.php:37
MagicWordFactory
A factory that stores information about MagicWords, and creates them on demand with caching.
Definition: MagicWordFactory.php:34
MediaWiki\MediaWikiServices\getSiteLookup
getSiteLookup()
Definition: MediaWikiServices.php:1044
MediaWiki\MediaWikiServices\getParserFactory
getParserFactory()
Definition: MediaWikiServices.php:891
MediaWiki\MediaWikiServices\getBlockManager
getBlockManager()
Definition: MediaWikiServices.php:497
MediaWiki\Block\BlockManager
A service class for checking blocks.
Definition: BlockManager.php:45
MediaWiki\MediaWikiServices\getBlockRestrictionStore
getBlockRestrictionStore()
Definition: MediaWikiServices.php:505
MediaWiki\MediaWikiServices\getDBLoadBalancer
getDBLoadBalancer()
Definition: MediaWikiServices.php:602
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:130
MimeAnalyzer
Implements functions related to MIME types such as detection and mapping to file extension.
Definition: MimeAnalyzer.php:31
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:79
MediaWiki\Block\BlockErrorFormatter
A service class for getting formatted information about a block.
Definition: BlockErrorFormatter.php:34
MediaWiki\Http\HttpRequestFactory
Factory creating MWHttpRequest objects.
Definition: HttpRequestFactory.php:35
MediaWiki\MediaWikiServices\getContentModelStore
getContentModelStore()
Definition: MediaWikiServices.php:578
MediaWiki\MediaWikiServices\getChangeTagDefStore
getChangeTagDefStore()
Definition: MediaWikiServices.php:530
MediaWiki\Languages\LanguageFactory
Internationalisation code.
Definition: LanguageFactory.php:43
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
MediaWiki\MediaWikiServices\getRevisionLookup
getRevisionLookup()
Definition: MediaWikiServices.php:979
ReadOnlyMode
A service class for fetching the wiki's current read-only mode.
Definition: ReadOnlyMode.php:11
MediaWiki\MediaWikiServices\getBootstrapConfig
getBootstrapConfig()
Returns the Config object containing the bootstrap configuration.
Definition: MediaWikiServices.php:522
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory
Service to construct LockManagerGroups.
Definition: LockManagerGroupFactory.php:11
MediaWiki\MediaWikiServices\getCommentStore
getCommentStore()
Definition: MediaWikiServices.php:538
MediaWiki\MediaWikiServices\getSlotRoleStore
getSlotRoleStore()
Definition: MediaWikiServices.php:1076
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:34
MediaWiki\Languages\LanguageFallback
Definition: LanguageFallback.php:13
ConfiguredReadOnlyMode
A read-only mode service which does not depend on LoadBalancer.
Definition: ConfiguredReadOnlyMode.php:9
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
MediaWiki\MediaWikiServices\getExternalStoreAccess
getExternalStoreAccess()
Definition: MediaWikiServices.php:626
BagOStuff
Class representing a cache/ephemeral data store.
Definition: BagOStuff.php:63
MediaWiki\Linker\LinkRendererFactory
Factory to create LinkRender objects.
Definition: LinkRendererFactory.php:32
SearchEngineFactory
Factory class for SearchEngine.
Definition: SearchEngineFactory.php:11
Revision\RevisionFactory
Service for constructing revision objects.
Definition: RevisionFactory.php:37
MediaWiki\MediaWikiServices\getActorMigration
getActorMigration()
Definition: MediaWikiServices.php:457
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:38
MediaWiki\MediaWikiServices\getPermissionManager
getPermissionManager()
Definition: MediaWikiServices.php:923
MediaWiki\MediaWikiServices\getLanguageFallback
getLanguageFallback()
Definition: MediaWikiServices.php:682
MediaWiki\MediaWikiServices\getGenderCache
getGenderCache()
Definition: MediaWikiServices.php:650
MediaWiki\MediaWikiServices\getEventRelayerGroup
getEventRelayerGroup()
Definition: MediaWikiServices.php:618
MediaWiki\MediaWikiServices\getLockManagerGroupFactory
getLockManagerGroupFactory()
Definition: MediaWikiServices.php:749
Wikimedia\Services\NoSuchServiceException
Exception thrown when the requested service is not known.
Definition: NoSuchServiceException.php:35
SiteLookup
Definition: SiteLookup.php:28
Revision\RevisionLookup
Service for looking up page revisions.
Definition: RevisionLookup.php:38
ExternalStoreAccess
Key/value blob storage for a collection of storage medium types (e.g.
Definition: ExternalStoreAccess.php:22
MediaHandlerFactory
Class to construct MediaHandler objects.
Definition: MediaHandlerFactory.php:29
MediaWiki\MediaWikiServices\getOldRevisionImporter
getOldRevisionImporter()
Definition: MediaWikiServices.php:859
MediaWiki\MediaWikiServices\getPasswordReset
getPasswordReset()
Definition: MediaWikiServices.php:907
MediaWiki\Languages\LanguageNameUtils
Definition: LanguageNameUtils.php:44
MediaWiki\MediaWikiServices\getUploadRevisionImporter
getUploadRevisionImporter()
Definition: MediaWikiServices.php:1132
MediaWiki\MediaWikiServices\getProxyLookup
getProxyLookup()
Definition: MediaWikiServices.php:939
MediaWiki\MediaWikiServices\getSkinFactory
getSkinFactory()
Definition: MediaWikiServices.php:1060
SiteStore
Definition: SiteStore.php:29
MediaWiki\MediaWikiServices\failIfResetNotAllowed
static failIfResetNotAllowed( $method)
Convenience method that throws an exception unless it is called during a phase in which resetting of ...
Definition: MediaWikiServices.php:426
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:161
MediaWiki\MediaWikiServices\getLocalisationCache
getLocalisationCache()
Definition: MediaWikiServices.php:733
Config
Interface for configuration instances.
Definition: Config.php:28
MediaWiki\MediaWikiServices\getSpecialPageFactory
getSpecialPageFactory()
Definition: MediaWikiServices.php:1084
MediaWiki\MediaWikiServices\getMagicWordFactory
getMagicWordFactory()
Definition: MediaWikiServices.php:757
MediaWiki\MediaWikiServices\getPerDbNameStatsdDataFactory
getPerDbNameStatsdDataFactory()
Definition: MediaWikiServices.php:915
MWException
MediaWiki exception.
Definition: MWException.php:26
MediaWiki\MediaWikiServices\resetServiceForTesting
resetServiceForTesting( $name, $destroy=true)
Resets the given service for testing purposes.
Definition: MediaWikiServices.php:391
MediaWiki\MediaWikiServices\getCryptHKDF
getCryptHKDF()
Definition: MediaWikiServices.php:586
Wikimedia\Services\ServiceContainer
ServiceContainer provides a generic service to manage named services using lazy instantiation based o...
Definition: ServiceContainer.php:49
MediaWiki\MediaWikiServices\resetGlobalInstance
static resetGlobalInstance(Config $bootstrapConfig=null, $quick='')
Creates a new instance of MediaWikiServices and sets it as the global default instance.
Definition: MediaWikiServices.php:237
MediaWiki\MediaWikiServices\getTempFSFileFactory
getTempFSFileFactory()
Definition: MediaWikiServices.php:1100
MediaWiki\MediaWikiServices\getWatchedItemStore
getWatchedItemStore()
Definition: MediaWikiServices.php:1156
MediaWiki\Storage\PageEditStash
Class for managing stashed edits used by the page updater classes.
Definition: PageEditStash.php:44
DateFormatterFactory
Definition: DateFormatterFactory.php:3
MediaWiki\MediaWikiServices\getMediaHandlerFactory
getMediaHandlerFactory()
Definition: MediaWikiServices.php:792
Config\get
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
CryptHKDF
Definition: CryptHKDF.php:33
MediaWiki\MediaWikiServices\getWatchedItemQueryService
getWatchedItemQueryService()
Definition: MediaWikiServices.php:1148
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
MediaWiki\MediaWikiServices\getTitleParser
getTitleParser()
Definition: MediaWikiServices.php:1124
WatchedItemQueryService
Definition: WatchedItemQueryService.php:21
ProxyLookup
Definition: ProxyLookup.php:27
VirtualRESTServiceClient
Virtual HTTP service client loosely styled after a Virtual File System.
Definition: VirtualRESTServiceClient.php:45
MediaWiki\Interwiki\InterwikiLookup
Service interface for looking up Interwiki records.
Definition: InterwikiLookup.php:32
MediaWiki\MediaWikiServices\getFileBackendGroup
getFileBackendGroup()
Definition: MediaWikiServices.php:642
MediaWiki
A helper class for throttling authentication attempts.
MediaWiki\MediaWikiServices\getMessageFormatterFactory
getMessageFormatterFactory()
Definition: MediaWikiServices.php:808
MediaWiki\MediaWikiServices\newSearchEngine
newSearchEngine()
Definition: MediaWikiServices.php:1011
MediaWiki\MediaWikiServices\getMainConfig
getMainConfig()
Returns the Config object that provides configuration for MediaWiki core.
Definition: MediaWikiServices.php:768
MediaWiki\MediaWikiServices\getObjectFactory
getObjectFactory()
ObjectFactory is intended for instantiating "handlers" from declarative definitions,...
Definition: MediaWikiServices.php:851
MediaWiki\MediaWikiServices\getSearchEngineFactory
getSearchEngineFactory()
Definition: MediaWikiServices.php:1028
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition: BlobStoreFactory.php:35
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:28
TitleParser
A title parser service for MediaWiki.
Definition: TitleParser.php:33
MediaWiki\MediaWikiServices\disableStorageBackend
static disableStorageBackend()
Disables all storage layer services.
Definition: MediaWikiServices.php:336
MediaWiki\MediaWikiServices\getRevisionStoreFactory
getRevisionStoreFactory()
Definition: MediaWikiServices.php:1003
MediaWiki\Page\MovePageFactory
Definition: MovePageFactory.php:36
MediaWiki\MediaWikiServices\getDBLoadBalancerFactory
getDBLoadBalancerFactory()
Definition: MediaWikiServices.php:610
MediaWiki\MediaWikiServices\newInstance
static newInstance(Config $bootstrapConfig, $loadWiring='')
Creates a new MediaWikiServices instance and initializes it according to the given $bootstrapConfig.
Definition: MediaWikiServices.php:306
MediaWiki\MediaWikiServices\getTitleFormatter
getTitleFormatter()
Definition: MediaWikiServices.php:1116
MediaWiki\MediaWikiServices\getLinkBatchFactory
getLinkBatchFactory()
Definition: MediaWikiServices.php:698
MediaWiki\MediaWikiServices\getHttpRequestFactory
getHttpRequestFactory()
Definition: MediaWikiServices.php:658
MediaWiki\MediaWikiServices\getRevisionFactory
getRevisionFactory()
Definition: MediaWikiServices.php:971
MediaWiki\MediaWikiServices\getParserCache
getParserCache()
Definition: MediaWikiServices.php:883
MediaWiki\MediaWikiServices\salvage
salvage(self $other)
@noinspection PhpDocSignatureInspection
Definition: MediaWikiServices.php:270
MediaWiki\FileBackend\FSFile\TempFSFileFactory
Definition: TempFSFileFactory.php:10
MediaWiki\MediaWikiServices\getPreferencesFactory
getPreferencesFactory()
Definition: MediaWikiServices.php:931
MediaWiki\Special\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:64
MediaWiki\MediaWikiServices\__construct
__construct(Config $config)
Definition: MediaWikiServices.php:442
Wikimedia\Services\SalvageableService
SalvageableService defines an interface for services that are able to salvage state from a previous i...
Definition: SalvageableService.php:36
ExternalStoreFactory
Definition: ExternalStoreFactory.php:15
Revision\RevisionRenderer
The RevisionRenderer service provides access to rendered output for revisions.
Definition: RevisionRenderer.php:45
MediaWiki\Permissions\PermissionManager
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
Definition: PermissionManager.php:48
MediaWiki\MediaWikiServices\getPasswordFactory
getPasswordFactory()
Definition: MediaWikiServices.php:899
ParserFactory
Definition: ParserFactory.php:33
MediaWiki\MediaWikiServices\getPageEditStash
getPageEditStash()
Definition: MediaWikiServices.php:867
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporterNoUpdates
getWikiRevisionOldRevisionImporterNoUpdates()
Definition: MediaWikiServices.php:1172
MediaWiki\MediaWikiServices\getVirtualRESTServiceClient
getVirtualRESTServiceClient()
Definition: MediaWikiServices.php:1140
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:29
MediaWiki\MediaWikiServices\getBadFileLookup
getBadFileLookup()
Definition: MediaWikiServices.php:465
MediaWiki\MediaWikiServices\getConfigFactory
getConfigFactory()
Definition: MediaWikiServices.php:546
MediaWiki\Shell\CommandFactory
Factory facilitating dependency injection for Command.
Definition: CommandFactory.php:32
MediaWiki\MediaWikiServices\getWikiRevisionUploadImporter
getWikiRevisionUploadImporter()
Definition: MediaWikiServices.php:1180
MediaWiki\Preferences\PreferencesFactory
A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a given ...
Definition: PreferencesFactory.php:52
WANObjectCache
Multi-datacenter aware caching interface.
Definition: WANObjectCache.php:116
MediaWiki\MediaWikiServices\getRevisionRenderer
getRevisionRenderer()
Definition: MediaWikiServices.php:987
LocalisationCache
Class for caching the contents of localisation files, Messages*.php and *.i18n.php.
Definition: LocalisationCache.php:41
MediaWiki\Config\ConfigRepository
Object which holds currently registered configuration options.
Definition: ConfigRepository.php:33
MediaWiki\MediaWikiServices\hasInstance
static hasInstance()
Returns true if an instance has already been initialized.
Definition: MediaWikiServices.php:143
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:36
MediaWiki\MediaWikiServices\getExternalStoreFactory
getExternalStoreFactory()
Definition: MediaWikiServices.php:634
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:49
MediaWiki\MediaWikiServices\getDateFormatterFactory
getDateFormatterFactory()
Definition: MediaWikiServices.php:594
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:34
MediaWiki\MediaWikiServices\getTitleFactory
getTitleFactory()
Definition: MediaWikiServices.php:1108
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:35
MediaWiki\MediaWikiServices\getMainWANObjectCache
getMainWANObjectCache()
Definition: MediaWikiServices.php:784
MediaWiki\MediaWikiServices\getMimeAnalyzer
getMimeAnalyzer()
Definition: MediaWikiServices.php:816
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:11
MediaWiki\MediaWikiServices\getSiteStore
getSiteStore()
Definition: MediaWikiServices.php:1052
MediaWiki\MediaWikiServices\getBlobStore
getBlobStore()
Definition: MediaWikiServices.php:473
Wikimedia\Message\IMessageFormatterFactory
A simple factory providing a message formatter for a given language code.
Definition: IMessageFormatterFactory.php:10
MediaWiki\MediaWikiServices\getLocalServerObjectCache
getLocalServerObjectCache()
Definition: MediaWikiServices.php:741
MediaWiki\MediaWikiServices\getMovePageFactory
getMovePageFactory()
Definition: MediaWikiServices.php:824
OldRevisionImporter
Definition: OldRevisionImporter.php:6
MediaWiki\MediaWikiServices\getBlobStoreFactory
getBlobStoreFactory()
Definition: MediaWikiServices.php:481
MediaWiki\MediaWikiServices\getConfiguredReadOnlyMode
getConfiguredReadOnlyMode()
Definition: MediaWikiServices.php:562
MediaWiki\MediaWikiServices\getLanguageFactory
getLanguageFactory()
Definition: MediaWikiServices.php:674
MediaWiki\MediaWikiServices\getRevisionStore
getRevisionStore()
Definition: MediaWikiServices.php:995
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporter
getWikiRevisionOldRevisionImporter()
Definition: MediaWikiServices.php:1164
MediaWiki\MediaWikiServices\getParser
getParser()
Definition: MediaWikiServices.php:875
MediaWiki\MediaWikiServices\getLanguageNameUtils
getLanguageNameUtils()
Definition: MediaWikiServices.php:690
MediaWiki\MediaWikiServices\getNamespaceInfo
getNamespaceInfo()
Definition: MediaWikiServices.php:832
MediaWiki\MediaWikiServices\resetChildProcessServices
static resetChildProcessServices()
Resets any services that may have become stale after a child process returns from after pcntl_fork().
Definition: MediaWikiServices.php:360
MediaWiki\MediaWikiServices\getSlotRoleRegistry
getSlotRoleRegistry()
Definition: MediaWikiServices.php:1068
TitleFormatter
A title formatter service for MediaWiki.
Definition: TitleFormatter.php:34
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:40
MediaWiki\MediaWikiServices\getContentLanguage
getContentLanguage()
Definition: MediaWikiServices.php:570
TitleFactory
Creates Title objects.
Definition: TitleFactory.php:33
MediaWiki\MediaWikiServices\getConfigRepository
getConfigRepository()
Definition: MediaWikiServices.php:554
RepoGroup
Prioritized list of file repositories.
Definition: RepoGroup.php:31
ParserCache
Definition: ParserCache.php:30
ConfigFactory
Factory class to create Config objects.
Definition: ConfigFactory.php:31
MediaWiki\Storage\NameTableStoreFactory
Definition: NameTableStoreFactory.php:26
SearchEngineConfig
Configuration handling class for SearchEngine.
Definition: SearchEngineConfig.php:9
Revision\SlotRoleRegistry
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Definition: SlotRoleRegistry.php:48
PasswordFactory
Factory class for creating and checking Password objects.
Definition: PasswordFactory.php:30
NamespaceInfo
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Definition: NamespaceInfo.php:33
MediaWiki\MediaWikiServices\getLinkRendererFactory
getLinkRendererFactory()
Definition: MediaWikiServices.php:725
MediaWiki\MediaWikiServices\getLinkRenderer
getLinkRenderer()
LinkRenderer instance that can be used if no custom options are needed.
Definition: MediaWikiServices.php:717
MediaWiki\MediaWikiServices\getMainObjectStash
getMainObjectStash()
Definition: MediaWikiServices.php:776
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:30
MessageCache
Cache of messages that are defined by MediaWiki namespace pages or by hooks.
Definition: MessageCache.php:43
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
MediaWiki\MediaWikiServices\getLinkCache
getLinkCache()
Definition: MediaWikiServices.php:706
PasswordReset
Helper class for the password reset functionality shared by the web UI and the API.
Definition: PasswordReset.php:41
MediaWiki\MediaWikiServices\getReadOnlyMode
getReadOnlyMode()
Definition: MediaWikiServices.php:947
Language
Internationalisation code.
Definition: Language.php:39
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81
Hooks
Hooks class.
Definition: Hooks.php:34
MediaWiki\MediaWikiServices\forceGlobalInstance
static forceGlobalInstance(MediaWikiServices $services)
Replaces the global MediaWikiServices instance.
Definition: MediaWikiServices.php:187
MediaWiki\Block\BlockRestrictionStore
Definition: BlockRestrictionStore.php:34
MediaWiki\MediaWikiServices\getStatsdDataFactory
getStatsdDataFactory()
Definition: MediaWikiServices.php:1092
MediaWiki\MediaWikiServices\getNameTableStoreFactory
getNameTableStoreFactory()
Definition: MediaWikiServices.php:840
MediaWiki\MediaWikiServices\getRepoGroup
getRepoGroup()
Definition: MediaWikiServices.php:955