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 JobRunner;
22 use Language;
23 use LinkCache;
24 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
63 use MessageCache;
64 use MimeAnalyzer;
65 use MWException;
66 use NamespaceInfo;
67 use ObjectCache;
69 use Parser;
70 use ParserCache;
71 use ParserFactory;
72 use PasswordFactory;
73 use PasswordReset;
74 use ProxyLookup;
75 use ReadOnlyMode;
76 use RepoGroup;
77 use ResourceLoader;
78 use SearchEngine;
81 use SiteLookup;
82 use SiteStore;
83 use SkinFactory;
84 use TitleFactory;
85 use TitleFormatter;
86 use TitleParser;
89 use WANObjectCache;
93 use Wikimedia\ObjectFactory;
100 
137 class MediaWikiServices extends ServiceContainer {
138 
142  private static $instance = null;
143 
150  public static function hasInstance() {
151  return self::$instance !== null;
152  }
153 
168  public static function getInstance() {
169  if ( self::$instance === null ) {
170  // NOTE: constructing GlobalVarConfig here is not particularly pretty,
171  // but some information from the global scope has to be injected here,
172  // even if it's just a file name or database credentials to load
173  // configuration from.
174  $bootstrapConfig = new GlobalVarConfig();
175  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
176  }
177 
178  return self::$instance;
179  }
180 
194  public static function forceGlobalInstance( MediaWikiServices $services ) {
195  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
196  throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
197  }
198 
199  $old = self::getInstance();
200  self::$instance = $services;
201 
202  return $old;
203  }
204 
244  public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
245  if ( self::$instance === null ) {
246  // no global instance yet, nothing to reset
247  return;
248  }
249 
250  self::failIfResetNotAllowed( __METHOD__ );
251 
252  if ( $bootstrapConfig === null ) {
253  $bootstrapConfig = self::$instance->getBootstrapConfig();
254  }
255 
256  $oldInstance = self::$instance;
257 
258  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
259  self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
260 
261  if ( $quick === 'quick' ) {
262  self::$instance->salvage( $oldInstance );
263  } else {
264  $oldInstance->destroy();
265  }
266  }
267 
277  private function salvage( self $other ) {
278  foreach ( $this->getServiceNames() as $name ) {
279  // The service could be new in the new instance and not registered in the
280  // other instance (e.g. an extension that was loaded after the instantiation of
281  // the other instance. Skip this service in this case. See T143974
282  try {
283  $oldService = $other->peekService( $name );
284  } catch ( NoSuchServiceException $e ) {
285  continue;
286  }
287 
288  if ( $oldService instanceof SalvageableService ) {
290  $newService = $this->getService( $name );
291  $newService->salvage( $oldService );
292  }
293  }
294 
295  $other->destroy();
296  }
297 
313  private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
314  $instance = new self( $bootstrapConfig );
315 
316  // Load the default wiring from the specified files.
317  if ( $loadWiring === 'load' ) {
318  $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
319  $instance->loadWiringFiles( $wiringFiles );
320  }
321 
322  // Provide a traditional hook point to allow extensions to configure services.
323  Hooks::run( 'MediaWikiServices', [ $instance ] );
324 
325  return $instance;
326  }
327 
343  public static function disableStorageBackend() {
344  // TODO: also disable some Caches, JobQueues, etc
345  $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
346  $services = self::getInstance();
347 
348  foreach ( $destroy as $name ) {
349  $services->disableService( $name );
350  }
351 
353  }
354 
367  public static function resetChildProcessServices() {
368  // NOTE: for now, just reset everything. Since we don't know the interdependencies
369  // between services, we can't do this more selectively at this time.
370  self::resetGlobalInstance();
371 
372  // Child, reseed because there is no bug in PHP:
373  // https://bugs.php.net/bug.php?id=42465
374  mt_srand( getmypid() );
375  }
376 
398  public function resetServiceForTesting( $name, $destroy = true ) {
399  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
400  throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
401  }
402 
403  $this->resetService( $name, $destroy );
404  }
405 
433  public static function failIfResetNotAllowed( $method ) {
434  if ( !defined( 'MW_PHPUNIT_TEST' )
435  && !defined( 'MW_PARSER_TEST' )
436  && !defined( 'MEDIAWIKI_INSTALL' )
437  && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
438  && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
439  ) {
440  throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
441  }
442  }
443 
449  public function __construct( Config $config ) {
450  parent::__construct();
451 
452  // Register the given Config object as the bootstrap config service.
453  $this->defineService( 'BootstrapConfig', function () use ( $config ) {
454  return $config;
455  } );
456  }
457 
458  // CONVENIENCE GETTERS ////////////////////////////////////////////////////
459 
464  public function getActorMigration() : ActorMigration {
465  return $this->getService( 'ActorMigration' );
466  }
467 
472  public function getAuthManager() : AuthManager {
473  return $this->getService( 'AuthManager' );
474  }
475 
480  public function getBadFileLookup() : BadFileLookup {
481  return $this->getService( 'BadFileLookup' );
482  }
483 
488  public function getBlobStore() : BlobStore {
489  return $this->getService( '_SqlBlobStore' );
490  }
491 
496  public function getBlobStoreFactory() : BlobStoreFactory {
497  return $this->getService( 'BlobStoreFactory' );
498  }
499 
504  public function getBlockErrorFormatter() : BlockErrorFormatter {
505  return $this->getService( 'BlockErrorFormatter' );
506  }
507 
512  public function getBlockManager() : BlockManager {
513  return $this->getService( 'BlockManager' );
514  }
515 
520  public function getBlockRestrictionStore() : BlockRestrictionStore {
521  return $this->getService( 'BlockRestrictionStore' );
522  }
523 
537  public function getBootstrapConfig() : Config {
538  return $this->getService( 'BootstrapConfig' );
539  }
540 
545  public function getChangeTagDefStore() : NameTableStore {
546  return $this->getService( 'NameTableStoreFactory' )->getChangeTagDef();
547  }
548 
553  public function getCommentStore() : CommentStore {
554  return $this->getService( 'CommentStore' );
555  }
556 
561  public function getConfigFactory() : ConfigFactory {
562  return $this->getService( 'ConfigFactory' );
563  }
564 
569  public function getConfigRepository() : ConfigRepository {
570  return $this->getService( 'ConfigRepository' );
571  }
572 
578  return $this->getService( 'ConfiguredReadOnlyMode' );
579  }
580 
585  public function getContentHandlerFactory() : IContentHandlerFactory {
586  return $this->getService( 'ContentHandlerFactory' );
587  }
588 
593  public function getContentLanguage() : Language {
594  return $this->getService( 'ContentLanguage' );
595  }
596 
601  public function getContentModelStore() : NameTableStore {
602  return $this->getService( 'NameTableStoreFactory' )->getContentModels();
603  }
604 
609  public function getCryptHKDF() : CryptHKDF {
610  return $this->getService( 'CryptHKDF' );
611  }
612 
618  return $this->getService( 'DateFormatterFactory' );
619  }
620 
625  public function getDBLoadBalancer() : ILoadBalancer {
626  return $this->getService( 'DBLoadBalancer' );
627  }
628 
633  public function getDBLoadBalancerFactory() : LBFactory {
634  return $this->getService( 'DBLoadBalancerFactory' );
635  }
636 
641  public function getEmailer() : IEmailer {
642  return $this->getService( 'Emailer' );
643  }
644 
650  return $this->getService( 'EventRelayerGroup' );
651  }
652 
658  return $this->getService( 'ExternalStoreAccess' );
659  }
660 
666  return $this->getService( 'ExternalStoreFactory' );
667  }
668 
673  public function getFileBackendGroup() : FileBackendGroup {
674  return $this->getService( 'FileBackendGroup' );
675  }
676 
681  public function getGenderCache() : GenderCache {
682  return $this->getService( 'GenderCache' );
683  }
684 
689  public function getGlobalIdGenerator() : GlobalIdGenerator {
690  return $this->getService( 'GlobalIdGenerator' );
691  }
692 
697  public function getHttpRequestFactory() : HttpRequestFactory {
698  return $this->getService( 'HttpRequestFactory' );
699  }
700 
705  public function getInterwikiLookup() : InterwikiLookup {
706  return $this->getService( 'InterwikiLookup' );
707  }
708 
713  public function getJobRunner() : JobRunner {
714  return $this->getService( 'JobRunner' );
715  }
716 
721  public function getLanguageConverterFactory() : LanguageConverterFactory {
722  return $this->getService( 'LanguageConverterFactory' );
723  }
724 
729  public function getLanguageFactory() : LanguageFactory {
730  return $this->getService( 'LanguageFactory' );
731  }
732 
737  public function getLanguageFallback() : LanguageFallback {
738  return $this->getService( 'LanguageFallback' );
739  }
740 
745  public function getLanguageNameUtils() {
746  return $this->getService( 'LanguageNameUtils' );
747  }
748 
753  public function getLinkBatchFactory() : LinkBatchFactory {
754  return $this->getService( 'LinkBatchFactory' );
755  }
756 
761  public function getLinkCache() : LinkCache {
762  return $this->getService( 'LinkCache' );
763  }
764 
772  public function getLinkRenderer() : LinkRenderer {
773  return $this->getService( 'LinkRenderer' );
774  }
775 
780  public function getLinkRendererFactory() : LinkRendererFactory {
781  return $this->getService( 'LinkRendererFactory' );
782  }
783 
789  return $this->getService( 'LocalisationCache' );
790  }
791 
796  public function getLocalServerObjectCache() : BagOStuff {
797  return $this->getService( 'LocalServerObjectCache' );
798  }
799 
804  public function getLockManagerGroupFactory() : LockManagerGroupFactory {
805  return $this->getService( 'LockManagerGroupFactory' );
806  }
807 
812  public function getMagicWordFactory() : MagicWordFactory {
813  return $this->getService( 'MagicWordFactory' );
814  }
815 
823  public function getMainConfig() : Config {
824  return $this->getService( 'MainConfig' );
825  }
826 
831  public function getMainObjectStash() : BagOStuff {
832  return $this->getService( 'MainObjectStash' );
833  }
834 
839  public function getMainWANObjectCache() : WANObjectCache {
840  return $this->getService( 'MainWANObjectCache' );
841  }
842 
848  return $this->getService( 'MediaHandlerFactory' );
849  }
850 
855  public function getMessageCache() : MessageCache {
856  return $this->getService( 'MessageCache' );
857  }
858 
863  public function getMessageFormatterFactory() : IMessageFormatterFactory {
864  return $this->getService( 'MessageFormatterFactory' );
865  }
866 
871  public function getMimeAnalyzer() : MimeAnalyzer {
872  return $this->getService( 'MimeAnalyzer' );
873  }
874 
879  public function getMovePageFactory() : MovePageFactory {
880  return $this->getService( 'MovePageFactory' );
881  }
882 
887  public function getNamespaceInfo() : NamespaceInfo {
888  return $this->getService( 'NamespaceInfo' );
889  }
890 
895  public function getNameTableStoreFactory() : NameTableStoreFactory {
896  return $this->getService( 'NameTableStoreFactory' );
897  }
898 
906  public function getObjectFactory() : ObjectFactory {
907  return $this->getService( 'ObjectFactory' );
908  }
909 
915  return $this->getService( 'OldRevisionImporter' );
916  }
917 
922  public function getPageEditStash() : PageEditStash {
923  return $this->getService( 'PageEditStash' );
924  }
925 
930  public function getParser() : Parser {
931  return $this->getService( 'Parser' );
932  }
933 
938  public function getParserCache() : ParserCache {
939  return $this->getService( 'ParserCache' );
940  }
941 
946  public function getParserFactory() : ParserFactory {
947  return $this->getService( 'ParserFactory' );
948  }
949 
954  public function getPasswordFactory() : PasswordFactory {
955  return $this->getService( 'PasswordFactory' );
956  }
957 
962  public function getPasswordReset() : PasswordReset {
963  return $this->getService( 'PasswordReset' );
964  }
965 
970  public function getPerDbNameStatsdDataFactory() : StatsdDataFactoryInterface {
971  return $this->getService( 'PerDbNameStatsdDataFactory' );
972  }
973 
978  public function getPermissionManager() : PermissionManager {
979  return $this->getService( 'PermissionManager' );
980  }
981 
986  public function getPreferencesFactory() : PreferencesFactory {
987  return $this->getService( 'PreferencesFactory' );
988  }
989 
994  public function getProxyLookup() : ProxyLookup {
995  return $this->getService( 'ProxyLookup' );
996  }
997 
1002  public function getReadOnlyMode() : ReadOnlyMode {
1003  return $this->getService( 'ReadOnlyMode' );
1004  }
1005 
1010  public function getRepoGroup() : RepoGroup {
1011  return $this->getService( 'RepoGroup' );
1012  }
1013 
1018  public function getResourceLoader() : ResourceLoader {
1019  return $this->getService( 'ResourceLoader' );
1020  }
1021 
1026  public function getRevisionFactory() : RevisionFactory {
1027  return $this->getService( 'RevisionFactory' );
1028  }
1029 
1034  public function getRevisionLookup() : RevisionLookup {
1035  return $this->getService( 'RevisionLookup' );
1036  }
1037 
1042  public function getRevisionRenderer() : RevisionRenderer {
1043  return $this->getService( 'RevisionRenderer' );
1044  }
1045 
1050  public function getRevisionStore() : RevisionStore {
1051  return $this->getService( 'RevisionStore' );
1052  }
1053 
1058  public function getRevisionStoreFactory() : RevisionStoreFactory {
1059  return $this->getService( 'RevisionStoreFactory' );
1060  }
1061 
1066  public function newSearchEngine() : SearchEngine {
1067  // New engine object every time, since they keep state
1068  return $this->getService( 'SearchEngineFactory' )->create();
1069  }
1070 
1076  return $this->getService( 'SearchEngineConfig' );
1077  }
1078 
1084  return $this->getService( 'SearchEngineFactory' );
1085  }
1086 
1091  public function getShellCommandFactory() : CommandFactory {
1092  return $this->getService( 'ShellCommandFactory' );
1093  }
1094 
1099  public function getSiteLookup() : SiteLookup {
1100  return $this->getService( 'SiteLookup' );
1101  }
1102 
1107  public function getSiteStore() : SiteStore {
1108  return $this->getService( 'SiteStore' );
1109  }
1110 
1115  public function getSkinFactory() : SkinFactory {
1116  return $this->getService( 'SkinFactory' );
1117  }
1118 
1123  public function getSlotRoleRegistry() : SlotRoleRegistry {
1124  return $this->getService( 'SlotRoleRegistry' );
1125  }
1126 
1131  public function getSlotRoleStore() : NameTableStore {
1132  return $this->getService( 'NameTableStoreFactory' )->getSlotRoles();
1133  }
1134 
1140  return $this->getService( 'SpecialPageFactory' );
1141  }
1142 
1148  return $this->getService( 'StatsdDataFactory' );
1149  }
1150 
1155  public function getTempFSFileFactory() : TempFSFileFactory {
1156  return $this->getService( 'TempFSFileFactory' );
1157  }
1158 
1163  public function getTitleFactory() : TitleFactory {
1164  return $this->getService( 'TitleFactory' );
1165  }
1166 
1171  public function getTitleFormatter() : TitleFormatter {
1172  return $this->getService( 'TitleFormatter' );
1173  }
1174 
1179  public function getTitleParser() : TitleParser {
1180  return $this->getService( 'TitleParser' );
1181  }
1182 
1188  return $this->getService( 'UploadRevisionImporter' );
1189  }
1190 
1195  public function getUserNameUtils() : UserNameUtils {
1196  return $this->getService( 'UserNameUtils' );
1197  }
1198 
1204  return $this->getService( 'VirtualRESTServiceClient' );
1205  }
1206 
1212  return $this->getService( 'WatchedItemQueryService' );
1213  }
1214 
1220  return $this->getService( 'WatchedItemStore' );
1221  }
1222 
1228  return $this->getService( 'OldRevisionImporter' );
1229  }
1230 
1236  return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
1237  }
1238 
1244  return $this->getService( 'UploadRevisionImporter' );
1245  }
1246 
1247 }
EventRelayerGroup
Factory class for spawning EventRelayer objects using configuration.
Definition: EventRelayerGroup.php:26
MediaWiki\MediaWikiServices\getMessageCache
getMessageCache()
Definition: MediaWikiServices.php:855
MediaWiki\MediaWikiServices\getBlockErrorFormatter
getBlockErrorFormatter()
Definition: MediaWikiServices.php:504
ObjectCache\clear
static clear()
Clear all the cached instances.
Definition: ObjectCache.php:275
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:1091
SpecialPageFactory
Wrapper for backward compatibility for old callers that used static methods.
Definition: SpecialPageFactory_deprecated.php:34
MediaWiki\MediaWikiServices\getInterwikiLookup
getInterwikiLookup()
Definition: MediaWikiServices.php:705
MediaWiki\MediaWikiServices\getResourceLoader
getResourceLoader()
Definition: MediaWikiServices.php:1018
MediaWiki\MediaWikiServices\getSearchEngineConfig
getSearchEngineConfig()
Definition: MediaWikiServices.php:1075
UploadRevisionImporter
Definition: UploadRevisionImporter.php:6
Wikimedia\UUID\GlobalIdGenerator
Class for getting statistically unique IDs without a central coordinator.
Definition: GlobalIdGenerator.php:36
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:1099
MediaWiki\MediaWikiServices\getParserFactory
getParserFactory()
Definition: MediaWikiServices.php:946
MediaWiki\MediaWikiServices\getBlockManager
getBlockManager()
Definition: MediaWikiServices.php:512
MediaWiki\MediaWikiServices\getJobRunner
getJobRunner()
Definition: MediaWikiServices.php:713
MediaWiki\Block\BlockManager
A service class for checking blocks.
Definition: BlockManager.php:45
MediaWiki\MediaWikiServices\getBlockRestrictionStore
getBlockRestrictionStore()
Definition: MediaWikiServices.php:520
MediaWiki\MediaWikiServices\getDBLoadBalancer
getDBLoadBalancer()
Definition: MediaWikiServices.php:625
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:137
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:77
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:601
MediaWiki\MediaWikiServices\getChangeTagDefStore
getChangeTagDefStore()
Definition: MediaWikiServices.php:545
MediaWiki\MediaWikiServices\getLanguageConverterFactory
getLanguageConverterFactory()
Definition: MediaWikiServices.php:721
MediaWiki\Languages\LanguageFactory
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: LanguageFactory.php:41
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
MediaWiki\MediaWikiServices\getRevisionLookup
getRevisionLookup()
Definition: MediaWikiServices.php:1034
MediaWiki\SpecialPage\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:64
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:537
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory
Service to construct LockManagerGroups.
Definition: LockManagerGroupFactory.php:11
MediaWiki\MediaWikiServices\getCommentStore
getCommentStore()
Definition: MediaWikiServices.php:553
MediaWiki\MediaWikiServices\getGlobalIdGenerator
getGlobalIdGenerator()
Definition: MediaWikiServices.php:689
MediaWiki\MediaWikiServices\getSlotRoleStore
getSlotRoleStore()
Definition: MediaWikiServices.php:1131
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:34
MediaWiki\Languages\LanguageFallback
Definition: LanguageFallback.php:31
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:657
BagOStuff
Class representing a cache/ephemeral data store.
Definition: BagOStuff.php:65
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:38
MediaWiki\MediaWikiServices\getActorMigration
getActorMigration()
Definition: MediaWikiServices.php:464
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:38
MediaWiki\MediaWikiServices\getPermissionManager
getPermissionManager()
Definition: MediaWikiServices.php:978
MediaWiki\MediaWikiServices\getLanguageFallback
getLanguageFallback()
Definition: MediaWikiServices.php:737
MediaWiki\MediaWikiServices\getGenderCache
getGenderCache()
Definition: MediaWikiServices.php:681
MediaWiki\MediaWikiServices\getEventRelayerGroup
getEventRelayerGroup()
Definition: MediaWikiServices.php:649
MediaWiki\MediaWikiServices\getLockManagerGroupFactory
getLockManagerGroupFactory()
Definition: MediaWikiServices.php:804
MediaWiki\Languages\LanguageConverterFactory
An interface for creating language converters.
Definition: LanguageConverterFactory.php:44
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:914
MediaWiki\MediaWikiServices\getPasswordReset
getPasswordReset()
Definition: MediaWikiServices.php:962
MediaWiki\Languages\LanguageNameUtils
A service that provides utilities to do with language names and codes.
Definition: LanguageNameUtils.php:41
MediaWiki\MediaWikiServices\getUploadRevisionImporter
getUploadRevisionImporter()
Definition: MediaWikiServices.php:1187
MediaWiki\MediaWikiServices\getProxyLookup
getProxyLookup()
Definition: MediaWikiServices.php:994
MediaWiki\MediaWikiServices\getSkinFactory
getSkinFactory()
Definition: MediaWikiServices.php:1115
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:433
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:168
MediaWiki\MediaWikiServices\getLocalisationCache
getLocalisationCache()
Definition: MediaWikiServices.php:788
Config
Interface for configuration instances.
Definition: Config.php:28
MediaWiki\MediaWikiServices\getSpecialPageFactory
getSpecialPageFactory()
Definition: MediaWikiServices.php:1139
MediaWiki\MediaWikiServices\getAuthManager
getAuthManager()
Definition: MediaWikiServices.php:472
MediaWiki\MediaWikiServices\getMagicWordFactory
getMagicWordFactory()
Definition: MediaWikiServices.php:812
MediaWiki\MediaWikiServices\getPerDbNameStatsdDataFactory
getPerDbNameStatsdDataFactory()
Definition: MediaWikiServices.php:970
MWException
MediaWiki exception.
Definition: MWException.php:26
MediaWiki\MediaWikiServices\resetServiceForTesting
resetServiceForTesting( $name, $destroy=true)
Resets the given service for testing purposes.
Definition: MediaWikiServices.php:398
MediaWiki\MediaWikiServices\getCryptHKDF
getCryptHKDF()
Definition: MediaWikiServices.php:609
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:244
MediaWiki\MediaWikiServices\getTempFSFileFactory
getTempFSFileFactory()
Definition: MediaWikiServices.php:1155
MediaWiki\MediaWikiServices\getWatchedItemStore
getWatchedItemStore()
Definition: MediaWikiServices.php:1219
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\getContentHandlerFactory
getContentHandlerFactory()
Definition: MediaWikiServices.php:585
MediaWiki\MediaWikiServices\getMediaHandlerFactory
getMediaHandlerFactory()
Definition: MediaWikiServices.php:847
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:1211
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
MediaWiki\MediaWikiServices\getTitleParser
getTitleParser()
Definition: MediaWikiServices.php:1179
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:673
MediaWiki
A helper class for throttling authentication attempts.
MediaWiki\MediaWikiServices\getMessageFormatterFactory
getMessageFormatterFactory()
Definition: MediaWikiServices.php:863
MediaWiki\MediaWikiServices\newSearchEngine
newSearchEngine()
Definition: MediaWikiServices.php:1066
MediaWiki\MediaWikiServices\getMainConfig
getMainConfig()
Returns the Config object that provides configuration for MediaWiki core.
Definition: MediaWikiServices.php:823
MediaWiki\MediaWikiServices\getObjectFactory
getObjectFactory()
ObjectFactory is intended for instantiating "handlers" from declarative definitions,...
Definition: MediaWikiServices.php:906
MediaWiki\MediaWikiServices\getSearchEngineFactory
getSearchEngineFactory()
Definition: MediaWikiServices.php:1083
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:343
MediaWiki\MediaWikiServices\getRevisionStoreFactory
getRevisionStoreFactory()
Definition: MediaWikiServices.php:1058
MediaWiki\Page\MovePageFactory
Definition: MovePageFactory.php:38
MediaWiki\MediaWikiServices\getDBLoadBalancerFactory
getDBLoadBalancerFactory()
Definition: MediaWikiServices.php:633
MediaWiki\MediaWikiServices\newInstance
static newInstance(Config $bootstrapConfig, $loadWiring='')
Creates a new MediaWikiServices instance and initializes it according to the given $bootstrapConfig.
Definition: MediaWikiServices.php:313
MediaWiki\MediaWikiServices\getTitleFormatter
getTitleFormatter()
Definition: MediaWikiServices.php:1171
MediaWiki\MediaWikiServices\getLinkBatchFactory
getLinkBatchFactory()
Definition: MediaWikiServices.php:753
MediaWiki\MediaWikiServices\getHttpRequestFactory
getHttpRequestFactory()
Definition: MediaWikiServices.php:697
MediaWiki\MediaWikiServices\getRevisionFactory
getRevisionFactory()
Definition: MediaWikiServices.php:1026
MediaWiki\MediaWikiServices\getParserCache
getParserCache()
Definition: MediaWikiServices.php:938
MediaWiki\MediaWikiServices\salvage
salvage(self $other)
@noinspection PhpDocSignatureInspection
Definition: MediaWikiServices.php:277
MediaWiki\FileBackend\FSFile\TempFSFileFactory
Definition: TempFSFileFactory.php:10
MediaWiki\MediaWikiServices\getPreferencesFactory
getPreferencesFactory()
Definition: MediaWikiServices.php:986
MediaWiki\MediaWikiServices\__construct
__construct(Config $config)
Definition: MediaWikiServices.php:449
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:954
ParserFactory
Definition: ParserFactory.php:32
MediaWiki\MediaWikiServices\getPageEditStash
getPageEditStash()
Definition: MediaWikiServices.php:922
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporterNoUpdates
getWikiRevisionOldRevisionImporterNoUpdates()
Definition: MediaWikiServices.php:1235
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
MediaWiki\MediaWikiServices\getVirtualRESTServiceClient
getVirtualRESTServiceClient()
Definition: MediaWikiServices.php:1203
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:31
MediaWiki\MediaWikiServices\getBadFileLookup
getBadFileLookup()
Definition: MediaWikiServices.php:480
MediaWiki\MediaWikiServices\getConfigFactory
getConfigFactory()
Definition: MediaWikiServices.php:561
MediaWiki\Shell\CommandFactory
Factory facilitating dependency injection for Command.
Definition: CommandFactory.php:32
MediaWiki\MediaWikiServices\getWikiRevisionUploadImporter
getWikiRevisionUploadImporter()
Definition: MediaWikiServices.php:1243
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:118
MediaWiki\MediaWikiServices\getUserNameUtils
getUserNameUtils()
Definition: MediaWikiServices.php:1195
MediaWiki\MediaWikiServices\getRevisionRenderer
getRevisionRenderer()
Definition: MediaWikiServices.php:1042
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:150
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:36
MediaWiki\MediaWikiServices\getExternalStoreFactory
getExternalStoreFactory()
Definition: MediaWikiServices.php:665
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:50
MediaWiki\MediaWikiServices\getDateFormatterFactory
getDateFormatterFactory()
Definition: MediaWikiServices.php:617
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:34
MediaWiki\MediaWikiServices\getTitleFactory
getTitleFactory()
Definition: MediaWikiServices.php:1163
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:86
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:35
MediaWiki\MediaWikiServices\getMainWANObjectCache
getMainWANObjectCache()
Definition: MediaWikiServices.php:839
MediaWiki\MediaWikiServices\getMimeAnalyzer
getMimeAnalyzer()
Definition: MediaWikiServices.php:871
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:11
MediaWiki\MediaWikiServices\getSiteStore
getSiteStore()
Definition: MediaWikiServices.php:1107
MediaWiki\MediaWikiServices\getBlobStore
getBlobStore()
Definition: MediaWikiServices.php:488
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:796
MediaWiki\MediaWikiServices\getMovePageFactory
getMovePageFactory()
Definition: MediaWikiServices.php:879
OldRevisionImporter
Definition: OldRevisionImporter.php:6
MediaWiki\MediaWikiServices\getBlobStoreFactory
getBlobStoreFactory()
Definition: MediaWikiServices.php:496
MediaWiki\MediaWikiServices\getConfiguredReadOnlyMode
getConfiguredReadOnlyMode()
Definition: MediaWikiServices.php:577
MediaWiki\MediaWikiServices\getLanguageFactory
getLanguageFactory()
Definition: MediaWikiServices.php:729
MediaWiki\MediaWikiServices\getRevisionStore
getRevisionStore()
Definition: MediaWikiServices.php:1050
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporter
getWikiRevisionOldRevisionImporter()
Definition: MediaWikiServices.php:1227
MediaWiki\User\UserNameUtils
UserNameUtils service.
Definition: UserNameUtils.php:38
MediaWiki\MediaWikiServices\getParser
getParser()
Definition: MediaWikiServices.php:930
MediaWiki\MediaWikiServices\getLanguageNameUtils
getLanguageNameUtils()
Definition: MediaWikiServices.php:745
MediaWiki\MediaWikiServices\getNamespaceInfo
getNamespaceInfo()
Definition: MediaWikiServices.php:887
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:367
MediaWiki\MediaWikiServices\getSlotRoleRegistry
getSlotRoleRegistry()
Definition: MediaWikiServices.php:1123
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:593
TitleFactory
Creates Title objects.
Definition: TitleFactory.php:33
MediaWiki\MediaWikiServices\getConfigRepository
getConfigRepository()
Definition: MediaWikiServices.php:569
MediaWiki\Mail\IEmailer
Interface for sending emails.
Definition: IEmailer.php:34
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
MediaWiki\MediaWikiServices\getEmailer
getEmailer()
Definition: MediaWikiServices.php:641
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:780
JobRunner
Job queue runner utility methods.
Definition: JobRunner.php:41
MediaWiki\MediaWikiServices\getLinkRenderer
getLinkRenderer()
LinkRenderer instance that can be used if no custom options are needed.
Definition: MediaWikiServices.php:772
MediaWiki\MediaWikiServices\getMainObjectStash
getMainObjectStash()
Definition: MediaWikiServices.php:831
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:30
MessageCache
Cache of messages that are defined by MediaWiki namespace pages or by hooks.
Definition: MessageCache.php:47
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:761
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:1002
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
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:194
MediaWiki\Block\BlockRestrictionStore
Definition: BlockRestrictionStore.php:34
MediaWiki\MediaWikiServices\getStatsdDataFactory
getStatsdDataFactory()
Definition: MediaWikiServices.php:1147
MediaWiki\MediaWikiServices\getNameTableStoreFactory
getNameTableStoreFactory()
Definition: MediaWikiServices.php:895
MediaWiki\MediaWikiServices\getRepoGroup
getRepoGroup()
Definition: MediaWikiServices.php:1010