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;
21 use JobRunner;
22 use Language;
23 use LinkCache;
24 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
78 use MessageCache;
79 use MimeAnalyzer;
80 use MWException;
81 use NamespaceInfo;
82 use ObjectCache;
84 use Parser;
85 use ParserCache;
86 use ParserFactory;
87 use PasswordFactory;
88 use PasswordReset;
89 use ProxyLookup;
90 use ReadOnlyMode;
91 use RepoGroup;
92 use ResourceLoader;
93 use SearchEngine;
96 use SiteLookup;
97 use SiteStore;
98 use SkinFactory;
99 use TitleFactory;
100 use TitleFormatter;
101 use TitleParser;
104 use WANObjectCache;
108 use Wikimedia\ObjectFactory;
111 use Wikimedia\Services\NoSuchServiceException;
112 use Wikimedia\Services\SalvageableService;
113 use Wikimedia\Services\ServiceContainer;
115 
152 class MediaWikiServices extends ServiceContainer {
153 
157  private static $instance = null;
158 
165  public static function hasInstance() {
166  return self::$instance !== null;
167  }
168 
183  public static function getInstance() : self {
184  if ( self::$instance === null ) {
185  // NOTE: constructing GlobalVarConfig here is not particularly pretty,
186  // but some information from the global scope has to be injected here,
187  // even if it's just a file name or database credentials to load
188  // configuration from.
189  $bootstrapConfig = new GlobalVarConfig();
190  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
191 
192  // Provides a traditional hook point to allow extensions to configure services.
193  // NOTE: Ideally this would be in newInstance() but it causes an infinite run loop
194  $runner = new HookRunner( self::$instance->getHookContainer() );
195  $runner->onMediaWikiServices( self::$instance );
196  }
197  return self::$instance;
198  }
199 
213  public static function forceGlobalInstance( MediaWikiServices $services ) {
214  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
215  throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
216  }
217 
218  $old = self::getInstance();
219  self::$instance = $services;
220 
221  return $old;
222  }
223 
263  public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
264  if ( self::$instance === null ) {
265  // no global instance yet, nothing to reset
266  return;
267  }
268 
269  self::failIfResetNotAllowed( __METHOD__ );
270 
271  if ( $bootstrapConfig === null ) {
272  $bootstrapConfig = self::$instance->getBootstrapConfig();
273  }
274 
275  $oldInstance = self::$instance;
276 
277  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
278 
279  // Provides a traditional hook point to allow extensions to configure services.
280  $runner = new HookRunner( self::$instance->getHookContainer() );
281  $runner->onMediaWikiServices( self::$instance );
282 
283  self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
284 
285  if ( $quick === 'quick' ) {
286  self::$instance->salvage( $oldInstance );
287  } else {
288  $oldInstance->destroy();
289  }
290  }
291 
301  private function salvage( self $other ) {
302  foreach ( $this->getServiceNames() as $name ) {
303  // The service could be new in the new instance and not registered in the
304  // other instance (e.g. an extension that was loaded after the instantiation of
305  // the other instance. Skip this service in this case. See T143974
306  try {
307  $oldService = $other->peekService( $name );
308  } catch ( NoSuchServiceException $e ) {
309  continue;
310  }
311 
312  if ( $oldService instanceof SalvageableService ) {
314  $newService = $this->getService( $name );
315  $newService->salvage( $oldService );
316  }
317  }
318 
319  $other->destroy();
320  }
321 
337  private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
338  $instance = new self( $bootstrapConfig );
339 
340  // Load the default wiring from the specified files.
341  if ( $loadWiring === 'load' ) {
342  $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
343  $instance->loadWiringFiles( $wiringFiles );
344  }
345 
346  return $instance;
347  }
348 
364  public static function disableStorageBackend() {
365  // TODO: also disable some Caches, JobQueues, etc
366  $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
367  $services = self::getInstance();
368 
369  foreach ( $destroy as $name ) {
370  $services->disableService( $name );
371  }
372 
374  }
375 
388  public static function resetChildProcessServices() {
389  // NOTE: for now, just reset everything. Since we don't know the interdependencies
390  // between services, we can't do this more selectively at this time.
391  self::resetGlobalInstance();
392 
393  // Child, reseed because there is no bug in PHP:
394  // https://bugs.php.net/bug.php?id=42465
395  mt_srand( getmypid() );
396  }
397 
419  public function resetServiceForTesting( $name, $destroy = true ) {
420  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
421  throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
422  }
423 
424  $this->resetService( $name, $destroy );
425  }
426 
454  public static function failIfResetNotAllowed( $method ) {
455  if ( !defined( 'MW_PHPUNIT_TEST' )
456  && !defined( 'MW_PARSER_TEST' )
457  && !defined( 'MEDIAWIKI_INSTALL' )
458  && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
459  && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
460  ) {
461  throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
462  }
463  }
464 
470  public function __construct( Config $config ) {
471  parent::__construct();
472 
473  // Register the given Config object as the bootstrap config service.
474  $this->defineService( 'BootstrapConfig', function () use ( $config ) {
475  return $config;
476  } );
477  }
478 
479  // CONVENIENCE GETTERS ////////////////////////////////////////////////////
480 
485  public function getActorMigration() : ActorMigration {
486  return $this->getService( 'ActorMigration' );
487  }
488 
493  public function getAuthManager() : AuthManager {
494  return $this->getService( 'AuthManager' );
495  }
496 
501  public function getBadFileLookup() : BadFileLookup {
502  return $this->getService( 'BadFileLookup' );
503  }
504 
509  public function getBlobStore() : BlobStore {
510  return $this->getService( 'BlobStore' );
511  }
512 
517  public function getBlobStoreFactory() : BlobStoreFactory {
518  return $this->getService( 'BlobStoreFactory' );
519  }
520 
525  public function getBlockErrorFormatter() : BlockErrorFormatter {
526  return $this->getService( 'BlockErrorFormatter' );
527  }
528 
533  public function getBlockManager() : BlockManager {
534  return $this->getService( 'BlockManager' );
535  }
536 
541  public function getBlockPermissionCheckerFactory() : BlockPermissionCheckerFactory {
542  return $this->getService( 'BlockPermissionCheckerFactory' );
543  }
544 
549  public function getBlockRestrictionStore() : BlockRestrictionStore {
550  return $this->getService( 'BlockRestrictionStore' );
551  }
552 
566  public function getBootstrapConfig() : Config {
567  return $this->getService( 'BootstrapConfig' );
568  }
569 
574  public function getChangeTagDefStore() : NameTableStore {
575  return $this->getService( 'ChangeTagDefStore' );
576  }
577 
582  public function getCommentStore() : CommentStore {
583  return $this->getService( 'CommentStore' );
584  }
585 
590  public function getConfigFactory() : ConfigFactory {
591  return $this->getService( 'ConfigFactory' );
592  }
593 
598  public function getConfigRepository() : ConfigRepository {
599  return $this->getService( 'ConfigRepository' );
600  }
601 
607  return $this->getService( 'ConfiguredReadOnlyMode' );
608  }
609 
614  public function getContentHandlerFactory() : IContentHandlerFactory {
615  return $this->getService( 'ContentHandlerFactory' );
616  }
617 
622  public function getContentLanguage() : Language {
623  return $this->getService( 'ContentLanguage' );
624  }
625 
630  public function getContentModelChangeFactory() : ContentModelChangeFactory {
631  return $this->getService( 'ContentModelChangeFactory' );
632  }
633 
638  public function getContentModelStore() : NameTableStore {
639  return $this->getService( 'ContentModelStore' );
640  }
641 
646  public function getContributionsLookup() : ContributionsLookup {
647  return $this->getService( 'ContributionsLookup' );
648  }
649 
654  public function getCryptHKDF() : CryptHKDF {
655  return $this->getService( 'CryptHKDF' );
656  }
657 
663  return $this->getService( 'DateFormatterFactory' );
664  }
665 
670  public function getDBLoadBalancer() : ILoadBalancer {
671  return $this->getService( 'DBLoadBalancer' );
672  }
673 
678  public function getDBLoadBalancerFactory() : LBFactory {
679  return $this->getService( 'DBLoadBalancerFactory' );
680  }
681 
686  public function getEmailer() : IEmailer {
687  return $this->getService( 'Emailer' );
688  }
689 
695  return $this->getService( 'EventRelayerGroup' );
696  }
697 
703  return $this->getService( 'ExternalStoreAccess' );
704  }
705 
711  return $this->getService( 'ExternalStoreFactory' );
712  }
713 
718  public function getFileBackendGroup() : FileBackendGroup {
719  return $this->getService( 'FileBackendGroup' );
720  }
721 
726  public function getGenderCache() : GenderCache {
727  return $this->getService( 'GenderCache' );
728  }
729 
734  public function getGlobalIdGenerator() : GlobalIdGenerator {
735  return $this->getService( 'GlobalIdGenerator' );
736  }
737 
742  public function getHookContainer() : HookContainer {
743  return $this->getService( 'HookContainer' );
744  }
745 
750  public function getHtmlCacheUpdater() : HtmlCacheUpdater {
751  return $this->getService( 'HtmlCacheUpdater' );
752  }
753 
758  public function getHttpRequestFactory() : HttpRequestFactory {
759  return $this->getService( 'HttpRequestFactory' );
760  }
761 
766  public function getInterwikiLookup() : InterwikiLookup {
767  return $this->getService( 'InterwikiLookup' );
768  }
769 
774  public function getJobRunner() : JobRunner {
775  return $this->getService( 'JobRunner' );
776  }
777 
782  public function getLanguageConverterFactory() : LanguageConverterFactory {
783  return $this->getService( 'LanguageConverterFactory' );
784  }
785 
790  public function getLanguageFactory() : LanguageFactory {
791  return $this->getService( 'LanguageFactory' );
792  }
793 
798  public function getLanguageFallback() : LanguageFallback {
799  return $this->getService( 'LanguageFallback' );
800  }
801 
806  public function getLanguageNameUtils() {
807  return $this->getService( 'LanguageNameUtils' );
808  }
809 
814  public function getLinkBatchFactory() : LinkBatchFactory {
815  return $this->getService( 'LinkBatchFactory' );
816  }
817 
822  public function getLinkCache() : LinkCache {
823  return $this->getService( 'LinkCache' );
824  }
825 
833  public function getLinkRenderer() : LinkRenderer {
834  return $this->getService( 'LinkRenderer' );
835  }
836 
841  public function getLinkRendererFactory() : LinkRendererFactory {
842  return $this->getService( 'LinkRendererFactory' );
843  }
844 
850  return $this->getService( 'LocalisationCache' );
851  }
852 
857  public function getLocalServerObjectCache() : BagOStuff {
858  return $this->getService( 'LocalServerObjectCache' );
859  }
860 
865  public function getLockManagerGroupFactory() : LockManagerGroupFactory {
866  return $this->getService( 'LockManagerGroupFactory' );
867  }
868 
873  public function getMagicWordFactory() : MagicWordFactory {
874  return $this->getService( 'MagicWordFactory' );
875  }
876 
884  public function getMainConfig() : Config {
885  return $this->getService( 'MainConfig' );
886  }
887 
892  public function getMainObjectStash() : BagOStuff {
893  return $this->getService( 'MainObjectStash' );
894  }
895 
900  public function getMainWANObjectCache() : WANObjectCache {
901  return $this->getService( 'MainWANObjectCache' );
902  }
903 
909  return $this->getService( 'MediaHandlerFactory' );
910  }
911 
916  public function getMergeHistoryFactory() : MergeHistoryFactory {
917  return $this->getService( 'MergeHistoryFactory' );
918  }
919 
924  public function getMessageCache() : MessageCache {
925  return $this->getService( 'MessageCache' );
926  }
927 
932  public function getMessageFormatterFactory() : IMessageFormatterFactory {
933  return $this->getService( 'MessageFormatterFactory' );
934  }
935 
940  public function getMimeAnalyzer() : MimeAnalyzer {
941  return $this->getService( 'MimeAnalyzer' );
942  }
943 
948  public function getMovePageFactory() : MovePageFactory {
949  return $this->getService( 'MovePageFactory' );
950  }
951 
956  public function getNamespaceInfo() : NamespaceInfo {
957  return $this->getService( 'NamespaceInfo' );
958  }
959 
964  public function getNameTableStoreFactory() : NameTableStoreFactory {
965  return $this->getService( 'NameTableStoreFactory' );
966  }
967 
975  public function getObjectFactory() : ObjectFactory {
976  return $this->getService( 'ObjectFactory' );
977  }
978 
984  return $this->getService( 'OldRevisionImporter' );
985  }
986 
991  public function getPageEditStash() : PageEditStash {
992  return $this->getService( 'PageEditStash' );
993  }
994 
999  public function getParser() : Parser {
1000  return $this->getService( 'Parser' );
1001  }
1002 
1007  public function getParserCache() : ParserCache {
1008  return $this->getService( 'ParserCache' );
1009  }
1010 
1015  public function getParserFactory() : ParserFactory {
1016  return $this->getService( 'ParserFactory' );
1017  }
1018 
1023  public function getPasswordFactory() : PasswordFactory {
1024  return $this->getService( 'PasswordFactory' );
1025  }
1026 
1031  public function getPasswordReset() : PasswordReset {
1032  return $this->getService( 'PasswordReset' );
1033  }
1034 
1039  public function getPerDbNameStatsdDataFactory() : StatsdDataFactoryInterface {
1040  return $this->getService( 'PerDbNameStatsdDataFactory' );
1041  }
1042 
1047  public function getPermissionManager() : PermissionManager {
1048  return $this->getService( 'PermissionManager' );
1049  }
1050 
1055  public function getPreferencesFactory() : PreferencesFactory {
1056  return $this->getService( 'PreferencesFactory' );
1057  }
1058 
1063  public function getProxyLookup() : ProxyLookup {
1064  return $this->getService( 'ProxyLookup' );
1065  }
1066 
1071  public function getReadOnlyMode() : ReadOnlyMode {
1072  return $this->getService( 'ReadOnlyMode' );
1073  }
1074 
1079  public function getRepoGroup() : RepoGroup {
1080  return $this->getService( 'RepoGroup' );
1081  }
1082 
1087  public function getResourceLoader() : ResourceLoader {
1088  return $this->getService( 'ResourceLoader' );
1089  }
1090 
1095  public function getRevisionFactory() : RevisionFactory {
1096  return $this->getService( 'RevisionFactory' );
1097  }
1098 
1103  public function getRevisionLookup() : RevisionLookup {
1104  return $this->getService( 'RevisionLookup' );
1105  }
1106 
1111  public function getRevisionRenderer() : RevisionRenderer {
1112  return $this->getService( 'RevisionRenderer' );
1113  }
1114 
1119  public function getRevisionStore() : RevisionStore {
1120  return $this->getService( 'RevisionStore' );
1121  }
1122 
1127  public function getRevisionStoreFactory() : RevisionStoreFactory {
1128  return $this->getService( 'RevisionStoreFactory' );
1129  }
1130 
1135  public function newSearchEngine() : SearchEngine {
1136  // New engine object every time, since they keep state
1137  return $this->getService( 'SearchEngineFactory' )->create();
1138  }
1139 
1145  return $this->getService( 'SearchEngineConfig' );
1146  }
1147 
1153  return $this->getService( 'SearchEngineFactory' );
1154  }
1155 
1160  public function getShellCommandFactory() : CommandFactory {
1161  return $this->getService( 'ShellCommandFactory' );
1162  }
1163 
1168  public function getSiteLookup() : SiteLookup {
1169  return $this->getService( 'SiteLookup' );
1170  }
1171 
1176  public function getSiteStore() : SiteStore {
1177  return $this->getService( 'SiteStore' );
1178  }
1179 
1184  public function getSkinFactory() : SkinFactory {
1185  return $this->getService( 'SkinFactory' );
1186  }
1187 
1192  public function getSlotRoleRegistry() : SlotRoleRegistry {
1193  return $this->getService( 'SlotRoleRegistry' );
1194  }
1195 
1200  public function getSlotRoleStore() : NameTableStore {
1201  return $this->getService( 'SlotRoleStore' );
1202  }
1203 
1208  public function getSpamChecker() : SpamChecker {
1209  return $this->getService( 'SpamChecker' );
1210  }
1211 
1217  return $this->getService( 'SpecialPageFactory' );
1218  }
1219 
1225  return $this->getService( 'StatsdDataFactory' );
1226  }
1227 
1232  public function getTalkPageNotificationManager() : TalkPageNotificationManager {
1233  return $this->getService( 'TalkPageNotificationManager' );
1234  }
1235 
1240  public function getTempFSFileFactory() : TempFSFileFactory {
1241  return $this->getService( 'TempFSFileFactory' );
1242  }
1243 
1248  public function getTitleFactory() : TitleFactory {
1249  return $this->getService( 'TitleFactory' );
1250  }
1251 
1256  public function getTitleFormatter() : TitleFormatter {
1257  return $this->getService( 'TitleFormatter' );
1258  }
1259 
1264  public function getTitleParser() : TitleParser {
1265  return $this->getService( 'TitleParser' );
1266  }
1267 
1273  return $this->getService( 'UploadRevisionImporter' );
1274  }
1275 
1280  public function getUserEditTracker() : UserEditTracker {
1281  return $this->getService( 'UserEditTracker' );
1282  }
1283 
1288  public function getUserFactory() : UserFactory {
1289  return $this->getService( 'UserFactory' );
1290  }
1291 
1296  public function getUserGroupManager() : UserGroupManager {
1297  return $this->getService( 'UserGroupManager' );
1298  }
1299 
1304  public function getUserGroupManagerFactory() : UserGroupManagerFactory {
1305  return $this->getService( 'UserGroupManagerFactory' );
1306  }
1307 
1312  public function getUserNameUtils() : UserNameUtils {
1313  return $this->getService( 'UserNameUtils' );
1314  }
1315 
1320  public function getUserOptionsLookup() : UserOptionsLookup {
1321  return $this->getService( 'UserOptionsLookup' );
1322  }
1323 
1328  public function getUserOptionsManager() : UserOptionsManager {
1329  return $this->getService( 'UserOptionsManager' );
1330  }
1331 
1337  return $this->getService( 'VirtualRESTServiceClient' );
1338  }
1339 
1345  return $this->getService( 'WatchedItemQueryService' );
1346  }
1347 
1353  return $this->getService( 'WatchedItemStore' );
1354  }
1355 
1360  public function getWatchlistNotificationManager() : WatchlistNotificationManager {
1361  return $this->getService( 'WatchlistNotificationManager' );
1362  }
1363 
1369  return $this->getService( 'OldRevisionImporter' );
1370  }
1371 
1377  return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
1378  }
1379 
1385  return $this->getService( 'UploadRevisionImporter' );
1386  }
1387 
1388 }
EventRelayerGroup
Factory class for spawning EventRelayer objects using configuration.
Definition: EventRelayerGroup.php:26
MediaWiki\MediaWikiServices\getMessageCache
getMessageCache()
Definition: MediaWikiServices.php:924
MediaWiki\MediaWikiServices\getBlockErrorFormatter
getBlockErrorFormatter()
Definition: MediaWikiServices.php:525
ObjectCache\clear
static clear()
Clear all the cached instances.
Definition: ObjectCache.php:281
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:1160
MediaWiki\Block\BlockPermissionCheckerFactory
Factory class for BlockPermissionChecker.
Definition: BlockPermissionCheckerFactory.php:32
SpecialPageFactory
Wrapper for backward compatibility for old callers that used static methods.
Definition: SpecialPageFactory_deprecated.php:34
MediaWiki\MediaWikiServices\getInterwikiLookup
getInterwikiLookup()
Definition: MediaWikiServices.php:766
MediaWiki\MediaWikiServices\getSpamChecker
getSpamChecker()
Definition: MediaWikiServices.php:1208
MediaWiki\MediaWikiServices\getResourceLoader
getResourceLoader()
Definition: MediaWikiServices.php:1087
MediaWiki\MediaWikiServices\getSearchEngineConfig
getSearchEngineConfig()
Definition: MediaWikiServices.php:1144
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:37
MediaWiki\MediaWikiServices\getSiteLookup
getSiteLookup()
Definition: MediaWikiServices.php:1168
MediaWiki\MediaWikiServices\getParserFactory
getParserFactory()
Definition: MediaWikiServices.php:1015
MediaWiki\MediaWikiServices\getBlockManager
getBlockManager()
Definition: MediaWikiServices.php:533
MediaWiki\MediaWikiServices\getJobRunner
getJobRunner()
Definition: MediaWikiServices.php:774
MediaWiki\Block\BlockManager
A service class for checking blocks.
Definition: BlockManager.php:46
MediaWiki\MediaWikiServices\getBlockRestrictionStore
getBlockRestrictionStore()
Definition: MediaWikiServices.php:549
MediaWiki\MediaWikiServices\getDBLoadBalancer
getDBLoadBalancer()
Definition: MediaWikiServices.php:670
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:152
MimeAnalyzer
Implements functions related to MIME types such as detection and mapping to file extension.
Definition: MimeAnalyzer.php:33
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:80
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:38
MediaWiki\MediaWikiServices\getContentModelStore
getContentModelStore()
Definition: MediaWikiServices.php:638
MediaWiki\MediaWikiServices\getChangeTagDefStore
getChangeTagDefStore()
Definition: MediaWikiServices.php:574
MediaWiki\MediaWikiServices\getLanguageConverterFactory
getLanguageConverterFactory()
Definition: MediaWikiServices.php:782
MediaWiki\Languages\LanguageFactory
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: LanguageFactory.php:42
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:43
MediaWiki\MediaWikiServices\getBlockPermissionCheckerFactory
getBlockPermissionCheckerFactory()
Definition: MediaWikiServices.php:541
MediaWiki\MediaWikiServices\getRevisionLookup
getRevisionLookup()
Definition: MediaWikiServices.php:1103
MediaWiki\SpecialPage\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:65
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:566
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory
Service to construct LockManagerGroups.
Definition: LockManagerGroupFactory.php:11
MediaWiki\MediaWikiServices\getCommentStore
getCommentStore()
Definition: MediaWikiServices.php:582
MediaWiki\MediaWikiServices\getGlobalIdGenerator
getGlobalIdGenerator()
Definition: MediaWikiServices.php:734
MediaWiki\MediaWikiServices\getSlotRoleStore
getSlotRoleStore()
Definition: MediaWikiServices.php:1200
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:36
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:702
MediaWiki\MediaWikiServices\getUserOptionsManager
getUserOptionsManager()
Definition: MediaWikiServices.php:1328
BagOStuff
Class representing a cache/ephemeral data store.
Definition: BagOStuff.php:70
MediaWiki\Linker\LinkRendererFactory
Factory to create LinkRender objects.
Definition: LinkRendererFactory.php:34
SearchEngineFactory
Factory class for SearchEngine.
Definition: SearchEngineFactory.php:13
Revision\RevisionFactory
Service for constructing revision objects.
Definition: RevisionFactory.php:38
MediaWiki\MediaWikiServices\getActorMigration
getActorMigration()
Definition: MediaWikiServices.php:485
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:38
MediaWiki\MediaWikiServices\getPermissionManager
getPermissionManager()
Definition: MediaWikiServices.php:1047
MediaWiki\MediaWikiServices\getLanguageFallback
getLanguageFallback()
Definition: MediaWikiServices.php:798
MediaWiki\MediaWikiServices\getGenderCache
getGenderCache()
Definition: MediaWikiServices.php:726
MediaWiki\MediaWikiServices\getEventRelayerGroup
getEventRelayerGroup()
Definition: MediaWikiServices.php:694
MediaWiki\MediaWikiServices\getLockManagerGroupFactory
getLockManagerGroupFactory()
Definition: MediaWikiServices.php:865
MediaWiki\Languages\LanguageConverterFactory
An interface for creating language converters.
Definition: LanguageConverterFactory.php:44
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\User\TalkPageNotificationManager
Manages user talk page notifications.
Definition: TalkPageNotificationManager.php:35
MediaWiki\MediaWikiServices\getOldRevisionImporter
getOldRevisionImporter()
Definition: MediaWikiServices.php:983
MediaWiki\MediaWikiServices\getPasswordReset
getPasswordReset()
Definition: MediaWikiServices.php:1031
MediaWiki\Languages\LanguageNameUtils
A service that provides utilities to do with language names and codes.
Definition: LanguageNameUtils.php:42
MediaWiki\MediaWikiServices\getUploadRevisionImporter
getUploadRevisionImporter()
Definition: MediaWikiServices.php:1272
MediaWiki\MediaWikiServices\getProxyLookup
getProxyLookup()
Definition: MediaWikiServices.php:1063
MediaWiki\MediaWikiServices\getSkinFactory
getSkinFactory()
Definition: MediaWikiServices.php:1184
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:454
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:183
MediaWiki\MediaWikiServices\getLocalisationCache
getLocalisationCache()
Definition: MediaWikiServices.php:849
Config
Interface for configuration instances.
Definition: Config.php:28
MediaWiki\User\UserGroupManager
Managers user groups.
Definition: UserGroupManager.php:51
Page\MergeHistoryFactory
Definition: MergeHistoryFactory.php:31
MediaWiki\MediaWikiServices\getSpecialPageFactory
getSpecialPageFactory()
Definition: MediaWikiServices.php:1216
MediaWiki\MediaWikiServices\getAuthManager
getAuthManager()
Definition: MediaWikiServices.php:493
MediaWiki\MediaWikiServices\getMagicWordFactory
getMagicWordFactory()
Definition: MediaWikiServices.php:873
MediaWiki\MediaWikiServices\getPerDbNameStatsdDataFactory
getPerDbNameStatsdDataFactory()
Definition: MediaWikiServices.php:1039
MWException
MediaWiki exception.
Definition: MWException.php:26
MediaWiki\MediaWikiServices\resetServiceForTesting
resetServiceForTesting( $name, $destroy=true)
Resets the given service for testing purposes.
Definition: MediaWikiServices.php:419
MediaWiki\MediaWikiServices\getCryptHKDF
getCryptHKDF()
Definition: MediaWikiServices.php:654
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:263
MediaWiki\MediaWikiServices\getTempFSFileFactory
getTempFSFileFactory()
Definition: MediaWikiServices.php:1240
MediaWiki\MediaWikiServices\getWatchedItemStore
getWatchedItemStore()
Definition: MediaWikiServices.php:1352
MediaWiki\Storage\PageEditStash
Class for managing stashed edits used by the page updater classes.
Definition: PageEditStash.php:46
DateFormatterFactory
Definition: DateFormatterFactory.php:3
MediaWiki\MediaWikiServices\getContentHandlerFactory
getContentHandlerFactory()
Definition: MediaWikiServices.php:614
MediaWiki\User\WatchlistNotificationManager
WatchlistNotificationManager service.
Definition: WatchlistNotificationManager.php:40
MediaWiki\MediaWikiServices\getMediaHandlerFactory
getMediaHandlerFactory()
Definition: MediaWikiServices.php:908
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:1344
MediaWiki\MediaWikiServices\getUserEditTracker
getUserEditTracker()
Definition: MediaWikiServices.php:1280
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
MediaWiki\MediaWikiServices\getUserFactory
getUserFactory()
Definition: MediaWikiServices.php:1288
MediaWiki\MediaWikiServices\getMergeHistoryFactory
getMergeHistoryFactory()
Definition: MediaWikiServices.php:916
MediaWiki\MediaWikiServices\getTitleParser
getTitleParser()
Definition: MediaWikiServices.php:1264
WatchedItemQueryService
Definition: WatchedItemQueryService.php:23
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:718
MediaWiki
A helper class for throttling authentication attempts.
MediaWiki\MediaWikiServices\getMessageFormatterFactory
getMessageFormatterFactory()
Definition: MediaWikiServices.php:932
MediaWiki\MediaWikiServices\newSearchEngine
newSearchEngine()
Definition: MediaWikiServices.php:1135
MediaWiki\MediaWikiServices\getMainConfig
getMainConfig()
Returns the Config object that provides configuration for MediaWiki core.
Definition: MediaWikiServices.php:884
MediaWiki\MediaWikiServices\getObjectFactory
getObjectFactory()
ObjectFactory is intended for instantiating "handlers" from declarative definitions,...
Definition: MediaWikiServices.php:975
MediaWiki\MediaWikiServices\getSearchEngineFactory
getSearchEngineFactory()
Definition: MediaWikiServices.php:1152
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:364
MediaWiki\MediaWikiServices\getRevisionStoreFactory
getRevisionStoreFactory()
Definition: MediaWikiServices.php:1127
MediaWiki\MediaWikiServices\getDBLoadBalancerFactory
getDBLoadBalancerFactory()
Definition: MediaWikiServices.php:678
MediaWiki\MediaWikiServices\newInstance
static newInstance(Config $bootstrapConfig, $loadWiring='')
Creates a new MediaWikiServices instance and initializes it according to the given $bootstrapConfig.
Definition: MediaWikiServices.php:337
MediaWiki\MediaWikiServices\getTitleFormatter
getTitleFormatter()
Definition: MediaWikiServices.php:1256
MediaWiki\MediaWikiServices\getLinkBatchFactory
getLinkBatchFactory()
Definition: MediaWikiServices.php:814
MediaWiki\MediaWikiServices\getHttpRequestFactory
getHttpRequestFactory()
Definition: MediaWikiServices.php:758
MediaWiki\MediaWikiServices\getRevisionFactory
getRevisionFactory()
Definition: MediaWikiServices.php:1095
MediaWiki\MediaWikiServices\getParserCache
getParserCache()
Definition: MediaWikiServices.php:1007
MediaWiki\MediaWikiServices\salvage
salvage(self $other)
@noinspection PhpDocSignatureInspection
Definition: MediaWikiServices.php:301
MediaWiki\FileBackend\FSFile\TempFSFileFactory
Definition: TempFSFileFactory.php:10
MediaWiki\MediaWikiServices\getPreferencesFactory
getPreferencesFactory()
Definition: MediaWikiServices.php:1055
MediaWiki\MediaWikiServices\__construct
__construct(Config $config)
Definition: MediaWikiServices.php:470
MediaWiki\MediaWikiServices\getContentModelChangeFactory
getContentModelChangeFactory()
Definition: MediaWikiServices.php:630
MediaWiki\User\UserGroupManagerFactory
Factory service for UserGroupManager instances.
Definition: UserGroupManagerFactory.php:35
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:49
MediaWiki\MediaWikiServices\getPasswordFactory
getPasswordFactory()
Definition: MediaWikiServices.php:1023
ParserFactory
Definition: ParserFactory.php:33
MediaWiki\MediaWikiServices\getPageEditStash
getPageEditStash()
Definition: MediaWikiServices.php:991
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporterNoUpdates
getWikiRevisionOldRevisionImporterNoUpdates()
Definition: MediaWikiServices.php:1376
MediaWiki\MediaWikiServices\getHtmlCacheUpdater
getHtmlCacheUpdater()
Definition: MediaWikiServices.php:750
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
MediaWiki\MediaWikiServices\getVirtualRESTServiceClient
getVirtualRESTServiceClient()
Definition: MediaWikiServices.php:1336
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:31
MediaWiki\EditPage\SpamChecker
Service to check if text (either content or a summary) qualifies as spam.
Definition: SpamChecker.php:14
MediaWiki\MediaWikiServices\getBadFileLookup
getBadFileLookup()
Definition: MediaWikiServices.php:501
MediaWiki\MediaWikiServices\getConfigFactory
getConfigFactory()
Definition: MediaWikiServices.php:590
MediaWiki\Shell\CommandFactory
Factory facilitating dependency injection for Command.
Definition: CommandFactory.php:32
MediaWiki\MediaWikiServices\getWikiRevisionUploadImporter
getWikiRevisionUploadImporter()
Definition: MediaWikiServices.php:1384
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:125
MediaWiki\MediaWikiServices\getUserNameUtils
getUserNameUtils()
Definition: MediaWikiServices.php:1312
MediaWiki\MediaWikiServices\getUserGroupManagerFactory
getUserGroupManagerFactory()
Definition: MediaWikiServices.php:1304
HtmlCacheUpdater
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Definition: HtmlCacheUpdater.php:30
MediaWiki\MediaWikiServices\getRevisionRenderer
getRevisionRenderer()
Definition: MediaWikiServices.php:1111
MediaWiki\MediaWikiServices\getUserOptionsLookup
getUserOptionsLookup()
Definition: MediaWikiServices.php:1320
MediaWiki\MediaWikiServices\getContributionsLookup
getContributionsLookup()
Definition: MediaWikiServices.php:646
LocalisationCache
Class for caching the contents of localisation files, Messages*.php and *.i18n.php.
Definition: LocalisationCache.php:43
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:165
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:36
MediaWiki\MediaWikiServices\getExternalStoreFactory
getExternalStoreFactory()
Definition: MediaWikiServices.php:710
Parser
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Definition: Parser.php:84
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:51
MediaWiki\User\UserOptionsLookup
Provides access to user options.
Definition: UserOptionsLookup.php:29
MediaWiki\MediaWikiServices\getDateFormatterFactory
getDateFormatterFactory()
Definition: MediaWikiServices.php:662
Page\MovePageFactory
Definition: MovePageFactory.php:30
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:36
MediaWiki\MediaWikiServices\getTitleFactory
getTitleFactory()
Definition: MediaWikiServices.php:1248
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:88
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:35
Revision\ContributionsLookup
Definition: ContributionsLookup.php:14
MediaWiki\User\UserOptionsManager
A service class to control user options.
Definition: UserOptionsManager.php:44
MediaWiki\MediaWikiServices\getMainWANObjectCache
getMainWANObjectCache()
Definition: MediaWikiServices.php:900
MediaWiki\MediaWikiServices\getMimeAnalyzer
getMimeAnalyzer()
Definition: MediaWikiServices.php:940
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:11
MediaWiki\MediaWikiServices\getSiteStore
getSiteStore()
Definition: MediaWikiServices.php:1176
MediaWiki\MediaWikiServices\getBlobStore
getBlobStore()
Definition: MediaWikiServices.php:509
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:857
MediaWiki\MediaWikiServices\getMovePageFactory
getMovePageFactory()
Definition: MediaWikiServices.php:948
ResourceLoader
ResourceLoader is a loading system for JavaScript and CSS resources.
Definition: ResourceLoader.php:56
OldRevisionImporter
Definition: OldRevisionImporter.php:6
MediaWiki\MediaWikiServices\getBlobStoreFactory
getBlobStoreFactory()
Definition: MediaWikiServices.php:517
MediaWiki\MediaWikiServices\getConfiguredReadOnlyMode
getConfiguredReadOnlyMode()
Definition: MediaWikiServices.php:606
MediaWiki\MediaWikiServices\getLanguageFactory
getLanguageFactory()
Definition: MediaWikiServices.php:790
MediaWiki\MediaWikiServices\getRevisionStore
getRevisionStore()
Definition: MediaWikiServices.php:1119
MediaWiki\User\UserEditTracker
Track info about user edit counts and timings.
Definition: UserEditTracker.php:17
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporter
getWikiRevisionOldRevisionImporter()
Definition: MediaWikiServices.php:1368
MediaWiki\User\UserNameUtils
UserNameUtils service.
Definition: UserNameUtils.php:42
MediaWiki\MediaWikiServices\getParser
getParser()
Definition: MediaWikiServices.php:999
MediaWiki\MediaWikiServices\getLanguageNameUtils
getLanguageNameUtils()
Definition: MediaWikiServices.php:806
MediaWiki\MediaWikiServices\getNamespaceInfo
getNamespaceInfo()
Definition: MediaWikiServices.php:956
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:388
MediaWiki\MediaWikiServices\getSlotRoleRegistry
getSlotRoleRegistry()
Definition: MediaWikiServices.php:1192
TitleFormatter
A title formatter service for MediaWiki.
Definition: TitleFormatter.php:34
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:41
MediaWiki\MediaWikiServices\getContentLanguage
getContentLanguage()
Definition: MediaWikiServices.php:622
TitleFactory
Creates Title objects.
Definition: TitleFactory.php:33
MediaWiki\MediaWikiServices\getConfigRepository
getConfigRepository()
Definition: MediaWikiServices.php:598
Page\ContentModelChangeFactory
Definition: ContentModelChangeFactory.php:32
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:32
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:12
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:686
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:44
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:35
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:571
MediaWiki\MediaWikiServices\getLinkRendererFactory
getLinkRendererFactory()
Definition: MediaWikiServices.php:841
MediaWiki\MediaWikiServices\getUserGroupManager
getUserGroupManager()
Definition: MediaWikiServices.php:1296
JobRunner
Job queue runner utility methods.
Definition: JobRunner.php:41
MediaWiki\MediaWikiServices\getTalkPageNotificationManager
getTalkPageNotificationManager()
Definition: MediaWikiServices.php:1232
MediaWiki\MediaWikiServices\getLinkRenderer
getLinkRenderer()
LinkRenderer instance that can be used if no custom options are needed.
Definition: MediaWikiServices.php:833
MediaWiki\MediaWikiServices\getHookContainer
getHookContainer()
Definition: MediaWikiServices.php:742
MediaWiki\MediaWikiServices\getWatchlistNotificationManager
getWatchlistNotificationManager()
Definition: MediaWikiServices.php:1360
MediaWiki\MediaWikiServices\getMainObjectStash
getMainObjectStash()
Definition: MediaWikiServices.php:892
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:30
MessageCache
Cache of messages that are defined by MediaWiki namespace pages or by hooks.
Definition: MessageCache.php:50
MediaWiki\MediaWikiServices\getLinkCache
getLinkCache()
Definition: MediaWikiServices.php:822
PasswordReset
Helper class for the password reset functionality shared by the web UI and the API.
Definition: PasswordReset.php:43
MediaWiki\MediaWikiServices\getReadOnlyMode
getReadOnlyMode()
Definition: MediaWikiServices.php:1071
MediaWiki\User\UserFactory
Creates User objects.
Definition: UserFactory.php:36
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: Language.php:41
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81
MediaWiki\MediaWikiServices\forceGlobalInstance
static forceGlobalInstance(MediaWikiServices $services)
Replaces the global MediaWikiServices instance.
Definition: MediaWikiServices.php:213
MediaWiki\Block\BlockRestrictionStore
Definition: BlockRestrictionStore.php:34
MediaWiki\MediaWikiServices\getStatsdDataFactory
getStatsdDataFactory()
Definition: MediaWikiServices.php:1224
MediaWiki\MediaWikiServices\getNameTableStoreFactory
getNameTableStoreFactory()
Definition: MediaWikiServices.php:964
MediaWiki\MediaWikiServices\getRepoGroup
getRepoGroup()
Definition: MediaWikiServices.php:1079