MediaWiki  1.32.5
MediaWikiServices.php
Go to the documentation of this file.
1 <?php
2 namespace MediaWiki;
3 
6 use Config;
13 use Hooks;
15 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
44 use Parser;
62 
99 class MediaWikiServices extends ServiceContainer {
100 
104  private static $instance = null;
105 
120  public static function getInstance() {
121  if ( self::$instance === null ) {
122  // NOTE: constructing GlobalVarConfig here is not particularly pretty,
123  // but some information from the global scope has to be injected here,
124  // even if it's just a file name or database credentials to load
125  // configuration from.
126  $bootstrapConfig = new GlobalVarConfig();
127  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
128  }
129 
130  return self::$instance;
131  }
132 
146  public static function forceGlobalInstance( MediaWikiServices $services ) {
147  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
148  throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
149  }
150 
151  $old = self::getInstance();
152  self::$instance = $services;
153 
154  return $old;
155  }
156 
196  public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
197  if ( self::$instance === null ) {
198  // no global instance yet, nothing to reset
199  return;
200  }
201 
202  self::failIfResetNotAllowed( __METHOD__ );
203 
204  if ( $bootstrapConfig === null ) {
205  $bootstrapConfig = self::$instance->getBootstrapConfig();
206  }
207 
208  $oldInstance = self::$instance;
209 
210  self::$instance = self::newInstance( $bootstrapConfig, 'load' );
211  self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
212 
213  if ( $quick === 'quick' ) {
214  self::$instance->salvage( $oldInstance );
215  } else {
216  $oldInstance->destroy();
217  }
218  }
219 
227  private function salvage( self $other ) {
228  foreach ( $this->getServiceNames() as $name ) {
229  // The service could be new in the new instance and not registered in the
230  // other instance (e.g. an extension that was loaded after the instantiation of
231  // the other instance. Skip this service in this case. See T143974
232  try {
233  $oldService = $other->peekService( $name );
234  } catch ( NoSuchServiceException $e ) {
235  continue;
236  }
237 
238  if ( $oldService instanceof SalvageableService ) {
240  $newService = $this->getService( $name );
241  $newService->salvage( $oldService );
242  }
243  }
244 
245  $other->destroy();
246  }
247 
263  private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
264  $instance = new self( $bootstrapConfig );
265 
266  // Load the default wiring from the specified files.
267  if ( $loadWiring === 'load' ) {
268  $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
269  $instance->loadWiringFiles( $wiringFiles );
270  }
271 
272  // Provide a traditional hook point to allow extensions to configure services.
273  Hooks::run( 'MediaWikiServices', [ $instance ] );
274 
275  return $instance;
276  }
277 
293  public static function disableStorageBackend() {
294  // TODO: also disable some Caches, JobQueues, etc
295  $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
296  $services = self::getInstance();
297 
298  foreach ( $destroy as $name ) {
299  $services->disableService( $name );
300  }
301 
303  }
304 
317  public static function resetChildProcessServices() {
318  // NOTE: for now, just reset everything. Since we don't know the interdependencies
319  // between services, we can't do this more selectively at this time.
320  self::resetGlobalInstance();
321 
322  // Child, reseed because there is no bug in PHP:
323  // https://bugs.php.net/bug.php?id=42465
324  mt_srand( getmypid() );
325  }
326 
348  public function resetServiceForTesting( $name, $destroy = true ) {
349  if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
350  throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
351  }
352 
353  $this->resetService( $name, $destroy );
354  }
355 
383  public static function failIfResetNotAllowed( $method ) {
384  if ( !defined( 'MW_PHPUNIT_TEST' )
385  && !defined( 'MW_PARSER_TEST' )
386  && !defined( 'MEDIAWIKI_INSTALL' )
387  && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
388  && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
389  ) {
390  throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
391  }
392  }
393 
399  public function __construct( Config $config ) {
400  parent::__construct();
401 
402  // Register the given Config object as the bootstrap config service.
403  $this->defineService( 'BootstrapConfig', function () use ( $config ) {
404  return $config;
405  } );
406  }
407 
408  // CONVENIENCE GETTERS ////////////////////////////////////////////////////
409 
414  public function getActorMigration() {
415  return $this->getService( 'ActorMigration' );
416  }
417 
422  public function getBlobStore() {
423  return $this->getService( '_SqlBlobStore' );
424  }
425 
430  public function getBlobStoreFactory() {
431  return $this->getService( 'BlobStoreFactory' );
432  }
433 
447  public function getBootstrapConfig() {
448  return $this->getService( 'BootstrapConfig' );
449  }
450 
455  public function getChangeTagDefStore() {
456  return $this->getService( 'NameTableStoreFactory' )->getChangeTagDef();
457  }
458 
463  public function getCommentStore() {
464  return $this->getService( 'CommentStore' );
465  }
466 
471  public function getConfigFactory() {
472  return $this->getService( 'ConfigFactory' );
473  }
474 
479  public function getConfigRepository() {
480  return $this->getService( 'ConfigRepository' );
481  }
482 
487  public function getConfiguredReadOnlyMode() {
488  return $this->getService( 'ConfiguredReadOnlyMode' );
489  }
490 
495  public function getContentLanguage() {
496  return $this->getService( 'ContentLanguage' );
497  }
498 
503  public function getContentModelStore() {
504  return $this->getService( 'NameTableStoreFactory' )->getContentModels();
505  }
506 
511  public function getCryptHKDF() {
512  return $this->getService( 'CryptHKDF' );
513  }
514 
520  public function getCryptRand() {
521  return $this->getService( 'CryptRand' );
522  }
523 
528  public function getDBLoadBalancer() {
529  return $this->getService( 'DBLoadBalancer' );
530  }
531 
536  public function getDBLoadBalancerFactory() {
537  return $this->getService( 'DBLoadBalancerFactory' );
538  }
539 
544  public function getEventRelayerGroup() {
545  return $this->getService( 'EventRelayerGroup' );
546  }
547 
552  public function getExternalStoreFactory() {
553  return $this->getService( 'ExternalStoreFactory' );
554  }
555 
560  public function getGenderCache() {
561  return $this->getService( 'GenderCache' );
562  }
563 
568  public function getHttpRequestFactory() {
569  return $this->getService( 'HttpRequestFactory' );
570  }
571 
576  public function getInterwikiLookup() {
577  return $this->getService( 'InterwikiLookup' );
578  }
579 
584  public function getLinkCache() {
585  return $this->getService( 'LinkCache' );
586  }
587 
595  public function getLinkRenderer() {
596  return $this->getService( 'LinkRenderer' );
597  }
598 
603  public function getLinkRendererFactory() {
604  return $this->getService( 'LinkRendererFactory' );
605  }
606 
611  public function getLocalServerObjectCache() {
612  return $this->getService( 'LocalServerObjectCache' );
613  }
614 
619  public function getMagicWordFactory() {
620  return $this->getService( 'MagicWordFactory' );
621  }
622 
630  public function getMainConfig() {
631  return $this->getService( 'MainConfig' );
632  }
633 
638  public function getMainObjectStash() {
639  return $this->getService( 'MainObjectStash' );
640  }
641 
646  public function getMainWANObjectCache() {
647  return $this->getService( 'MainWANObjectCache' );
648  }
649 
654  public function getMediaHandlerFactory() {
655  return $this->getService( 'MediaHandlerFactory' );
656  }
657 
662  public function getMimeAnalyzer() {
663  return $this->getService( 'MimeAnalyzer' );
664  }
665 
670  public function getNameTableStoreFactory() {
671  return $this->getService( 'NameTableStoreFactory' );
672  }
673 
677  public function getOldRevisionImporter() {
678  return $this->getService( 'OldRevisionImporter' );
679  }
680 
685  public function getParser() {
686  return $this->getService( 'Parser' );
687  }
688 
693  public function getParserCache() {
694  return $this->getService( 'ParserCache' );
695  }
696 
701  public function getParserFactory() {
702  return $this->getService( 'ParserFactory' );
703  }
704 
709  public function getPasswordFactory() {
710  return $this->getService( 'PasswordFactory' );
711  }
712 
717  public function getPerDbNameStatsdDataFactory() {
718  return $this->getService( 'PerDbNameStatsdDataFactory' );
719  }
720 
725  public function getPreferencesFactory() {
726  return $this->getService( 'PreferencesFactory' );
727  }
728 
733  public function getProxyLookup() {
734  return $this->getService( 'ProxyLookup' );
735  }
736 
741  public function getReadOnlyMode() {
742  return $this->getService( 'ReadOnlyMode' );
743  }
744 
749  public function getRevisionFactory() {
750  return $this->getService( 'RevisionFactory' );
751  }
752 
757  public function getRevisionLookup() {
758  return $this->getService( 'RevisionLookup' );
759  }
760 
765  public function getRevisionRenderer() {
766  return $this->getService( 'RevisionRenderer' );
767  }
768 
773  public function getRevisionStore() {
774  return $this->getService( 'RevisionStore' );
775  }
776 
781  public function getRevisionStoreFactory() {
782  return $this->getService( 'RevisionStoreFactory' );
783  }
784 
789  public function newSearchEngine() {
790  // New engine object every time, since they keep state
791  return $this->getService( 'SearchEngineFactory' )->create();
792  }
793 
798  public function getSearchEngineConfig() {
799  return $this->getService( 'SearchEngineConfig' );
800  }
801 
806  public function getSearchEngineFactory() {
807  return $this->getService( 'SearchEngineFactory' );
808  }
809 
814  public function getShellCommandFactory() {
815  return $this->getService( 'ShellCommandFactory' );
816  }
817 
822  public function getSiteLookup() {
823  return $this->getService( 'SiteLookup' );
824  }
825 
830  public function getSiteStore() {
831  return $this->getService( 'SiteStore' );
832  }
833 
838  public function getSkinFactory() {
839  return $this->getService( 'SkinFactory' );
840  }
841 
846  public function getSlotRoleStore() {
847  return $this->getService( 'NameTableStoreFactory' )->getSlotRoles();
848  }
849 
855  return $this->getService( 'SpecialPageFactory' );
856  }
857 
862  public function getStatsdDataFactory() {
863  return $this->getService( 'StatsdDataFactory' );
864  }
865 
870  public function getTitleFormatter() {
871  return $this->getService( 'TitleFormatter' );
872  }
873 
878  public function getTitleParser() {
879  return $this->getService( 'TitleParser' );
880  }
881 
886  public function getUploadRevisionImporter() {
887  return $this->getService( 'UploadRevisionImporter' );
888  }
889 
894  public function getVirtualRESTServiceClient() {
895  return $this->getService( 'VirtualRESTServiceClient' );
896  }
897 
902  public function getWatchedItemQueryService() {
903  return $this->getService( 'WatchedItemQueryService' );
904  }
905 
910  public function getWatchedItemStore() {
911  return $this->getService( 'WatchedItemStore' );
912  }
913 
919  return $this->getService( 'OldRevisionImporter' );
920  }
921 
927  return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
928  }
929 
934  public function getWikiRevisionUploadImporter() {
935  return $this->getService( 'UploadRevisionImporter' );
936  }
937 
938 }
EventRelayerGroup
Factory class for spawning EventRelayer objects using configuration.
Definition: EventRelayerGroup.php:28
ObjectCache\clear
static clear()
Clear all the cached instances.
Definition: ObjectCache.php:408
ObjectCache
Functions to get cache objects.
Definition: ObjectCache.php:80
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:814
SpecialPageFactory
Wrapper for backward compatibility for old callers that used static methods.
Definition: SpecialPageFactory_deprecated.php:34
MediaWiki\MediaWikiServices\getInterwikiLookup
getInterwikiLookup()
Definition: MediaWikiServices.php:576
MediaWiki\MediaWikiServices\getSearchEngineConfig
getSearchEngineConfig()
Definition: MediaWikiServices.php:798
UploadRevisionImporter
Definition: UploadRevisionImporter.php:6
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:822
MediaWiki\MediaWikiServices\getParserFactory
getParserFactory()
Definition: MediaWikiServices.php:701
MediaWiki\MediaWikiServices\getDBLoadBalancer
getDBLoadBalancer()
Definition: MediaWikiServices.php:528
MediaWiki\Services\ServiceContainer
ServiceContainer provides a generic service to manage named services using lazy instantiation based o...
Definition: ServiceContainer.php:46
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:99
MimeAnalyzer
Implements functions related to MIME types such as detection and mapping to file extension.
Definition: MimeAnalyzer.php:30
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:76
MediaWiki\Http\HttpRequestFactory
Factory creating MWHttpRequest objects.
Definition: HttpRequestFactory.php:33
MediaWiki\MediaWikiServices\getContentModelStore
getContentModelStore()
Definition: MediaWikiServices.php:503
MediaWiki\MediaWikiServices\getChangeTagDefStore
getChangeTagDefStore()
Definition: MediaWikiServices.php:455
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
MediaWiki\MediaWikiServices\getRevisionLookup
getRevisionLookup()
Definition: MediaWikiServices.php:757
MediaWiki\MediaWikiServices\getBootstrapConfig
getBootstrapConfig()
Returns the Config object containing the bootstrap configuration.
Definition: MediaWikiServices.php:447
MediaWiki\MediaWikiServices\getCryptRand
getCryptRand()
Definition: MediaWikiServices.php:520
MediaWiki\MediaWikiServices\getCommentStore
getCommentStore()
Definition: MediaWikiServices.php:463
MediaWiki\MediaWikiServices\getSlotRoleStore
getSlotRoleStore()
Definition: MediaWikiServices.php:846
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:31
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
MediaWiki\Services\NoSuchServiceException
Exception thrown when the requested service is not known.
Definition: NoSuchServiceException.php:33
MediaWiki\Linker\LinkRendererFactory
Factory to create LinkRender objects.
Definition: LinkRendererFactory.php:31
SearchEngineFactory
Factory class for SearchEngine.
Definition: SearchEngineFactory.php:9
Revision\RevisionFactory
Service for constructing revision objects.
Definition: RevisionFactory.php:37
MediaWiki\MediaWikiServices\getActorMigration
getActorMigration()
Definition: MediaWikiServices.php:414
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:35
MediaWiki\MediaWikiServices\getGenderCache
getGenderCache()
Definition: MediaWikiServices.php:560
MediaWiki\MediaWikiServices\getEventRelayerGroup
getEventRelayerGroup()
Definition: MediaWikiServices.php:544
SiteLookup
Definition: SiteLookup.php:28
Revision\RevisionLookup
Service for looking up page revisions.
Definition: RevisionLookup.php:38
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
MediaHandlerFactory
Class to construct MediaHandler objects.
Definition: MediaHandlerFactory.php:29
MediaWiki\MediaWikiServices\getOldRevisionImporter
getOldRevisionImporter()
Definition: MediaWikiServices.php:677
MediaWiki\MediaWikiServices\getUploadRevisionImporter
getUploadRevisionImporter()
Definition: MediaWikiServices.php:886
MediaWiki\MediaWikiServices\getProxyLookup
getProxyLookup()
Definition: MediaWikiServices.php:733
MediaWiki\MediaWikiServices\getSkinFactory
getSkinFactory()
Definition: MediaWikiServices.php:838
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:383
Config
Interface for configuration instances.
Definition: Config.php:28
MediaWiki\MediaWikiServices\getSpecialPageFactory
getSpecialPageFactory()
Definition: MediaWikiServices.php:854
MediaWiki\MediaWikiServices\getMagicWordFactory
getMagicWordFactory()
Definition: MediaWikiServices.php:619
MediaWiki\MediaWikiServices\getPerDbNameStatsdDataFactory
getPerDbNameStatsdDataFactory()
Definition: MediaWikiServices.php:717
MWException
MediaWiki exception.
Definition: MWException.php:26
MediaWiki\MediaWikiServices\resetServiceForTesting
resetServiceForTesting( $name, $destroy=true)
Resets the given service for testing purposes.
Definition: MediaWikiServices.php:348
MediaWiki\MediaWikiServices\getCryptHKDF
getCryptHKDF()
Definition: MediaWikiServices.php:511
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:196
MediaWiki\MediaWikiServices\getWatchedItemStore
getWatchedItemStore()
Definition: MediaWikiServices.php:910
MediaWiki\MediaWikiServices\getMediaHandlerFactory
getMediaHandlerFactory()
Definition: MediaWikiServices.php:654
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:902
MediaWiki\MediaWikiServices\getTitleParser
getTitleParser()
Definition: MediaWikiServices.php:878
WatchedItemQueryService
Definition: WatchedItemQueryService.php:18
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:31
MediaWiki
A helper class for throttling authentication attempts.
MediaWiki\MediaWikiServices\newSearchEngine
newSearchEngine()
Definition: MediaWikiServices.php:789
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
MediaWiki\MediaWikiServices\getMainConfig
getMainConfig()
Returns the Config object that provides configuration for MediaWiki core.
Definition: MediaWikiServices.php:630
MediaWiki\MediaWikiServices\getSearchEngineFactory
getSearchEngineFactory()
Definition: MediaWikiServices.php:806
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:293
MediaWiki\MediaWikiServices\getRevisionStoreFactory
getRevisionStoreFactory()
Definition: MediaWikiServices.php:781
MediaWiki\MediaWikiServices\getDBLoadBalancerFactory
getDBLoadBalancerFactory()
Definition: MediaWikiServices.php:536
MediaWiki\MediaWikiServices\newInstance
static newInstance(Config $bootstrapConfig, $loadWiring='')
Creates a new MediaWikiServices instance and initializes it according to the given $bootstrapConfig.
Definition: MediaWikiServices.php:263
MediaWiki\MediaWikiServices\getTitleFormatter
getTitleFormatter()
Definition: MediaWikiServices.php:870
MediaWiki\MediaWikiServices\getHttpRequestFactory
getHttpRequestFactory()
Definition: MediaWikiServices.php:568
Wikimedia\Rdbms\LoadBalancer
Database connection, tracking, load balancing, and transaction manager for a cluster.
Definition: LoadBalancer.php:41
MediaWiki\MediaWikiServices\getRevisionFactory
getRevisionFactory()
Definition: MediaWikiServices.php:749
MediaWiki\MediaWikiServices\getParserCache
getParserCache()
Definition: MediaWikiServices.php:693
MediaWiki\MediaWikiServices\salvage
salvage(self $other)
Salvages the state of any salvageable service instances in $other.
Definition: MediaWikiServices.php:227
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
MediaWiki\MediaWikiServices\getPreferencesFactory
getPreferencesFactory()
Definition: MediaWikiServices.php:725
MediaWiki\Special\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:63
MediaWiki\MediaWikiServices\__construct
__construct(Config $config)
Definition: MediaWikiServices.php:399
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:120
Revision\RevisionRenderer
The RevisionRenderer service provides access to rendered output for revisions.
Definition: RevisionRenderer.php:45
MediaWiki\MediaWikiServices\getPasswordFactory
getPasswordFactory()
Definition: MediaWikiServices.php:709
ParserFactory
Definition: ParserFactory.php:27
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2221
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporterNoUpdates
getWikiRevisionOldRevisionImporterNoUpdates()
Definition: MediaWikiServices.php:926
MediaWiki\MediaWikiServices\getVirtualRESTServiceClient
getVirtualRESTServiceClient()
Definition: MediaWikiServices.php:894
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:31
MediaWiki\MediaWikiServices\getConfigFactory
getConfigFactory()
Definition: MediaWikiServices.php:471
MediaWiki\Shell\CommandFactory
Factory facilitating dependency injection for Command.
Definition: CommandFactory.php:32
MediaWiki\MediaWikiServices\getWikiRevisionUploadImporter
getWikiRevisionUploadImporter()
Definition: MediaWikiServices.php:934
MediaWiki\Preferences\PreferencesFactory
A PreferencesFactory is a MediaWiki service that provides the definitions of preferences for a given ...
Definition: PreferencesFactory.php:51
MediaWiki\MediaWikiServices\getRevisionRenderer
getRevisionRenderer()
Definition: MediaWikiServices.php:765
MediaWiki\Services\SalvageableService
SalvageableService defines an interface for services that are able to salvage state from a previous i...
Definition: SalvageableService.php:35
MediaWiki\Config\ConfigRepository
Object which holds currently registered configuration options.
Definition: ConfigRepository.php:33
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:35
MediaWiki\MediaWikiServices\getExternalStoreFactory
getExternalStoreFactory()
Definition: MediaWikiServices.php:552
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:49
SearchEngine
Contain a class for special pages.
Definition: SearchEngine.php:34
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:33
MediaWiki\MediaWikiServices\getMainWANObjectCache
getMainWANObjectCache()
Definition: MediaWikiServices.php:646
MediaWiki\MediaWikiServices\getMimeAnalyzer
getMimeAnalyzer()
Definition: MediaWikiServices.php:662
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:10
MediaWiki\MediaWikiServices\getSiteStore
getSiteStore()
Definition: MediaWikiServices.php:830
MediaWiki\MediaWikiServices\getBlobStore
getBlobStore()
Definition: MediaWikiServices.php:422
MediaWiki\MediaWikiServices\getLocalServerObjectCache
getLocalServerObjectCache()
Definition: MediaWikiServices.php:611
OldRevisionImporter
Definition: OldRevisionImporter.php:6
MediaWiki\MediaWikiServices\getBlobStoreFactory
getBlobStoreFactory()
Definition: MediaWikiServices.php:430
MediaWiki\MediaWikiServices\getConfiguredReadOnlyMode
getConfiguredReadOnlyMode()
Definition: MediaWikiServices.php:487
MediaWiki\MediaWikiServices\getRevisionStore
getRevisionStore()
Definition: MediaWikiServices.php:773
MediaWiki\MediaWikiServices\getWikiRevisionOldRevisionImporter
getWikiRevisionOldRevisionImporter()
Definition: MediaWikiServices.php:918
MediaWiki\MediaWikiServices\getParser
getParser()
Definition: MediaWikiServices.php:685
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:317
TitleFormatter
A title formatter service for MediaWiki.
Definition: TitleFormatter.php:34
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:39
MediaWiki\MediaWikiServices\getContentLanguage
getContentLanguage()
Definition: MediaWikiServices.php:495
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
MediaWiki\MediaWikiServices\getConfigRepository
getConfigRepository()
Definition: MediaWikiServices.php:479
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
PasswordFactory
Factory class for creating and checking Password objects.
Definition: PasswordFactory.php:28
$services
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
Definition: hooks.txt:2278
MediaWiki\MediaWikiServices\getLinkRendererFactory
getLinkRendererFactory()
Definition: MediaWikiServices.php:603
MediaWiki\MediaWikiServices\getLinkRenderer
getLinkRenderer()
LinkRenderer instance that can be used if no custom options are needed.
Definition: MediaWikiServices.php:595
MediaWiki\MediaWikiServices\getMainObjectStash
getMainObjectStash()
Definition: MediaWikiServices.php:638
WatchedItemStoreInterface
Definition: WatchedItemStoreInterface.php:28
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:584
CryptRand
Definition: CryptRand.php:30
MediaWiki\MediaWikiServices\getReadOnlyMode
getReadOnlyMode()
Definition: MediaWikiServices.php:741
Hooks
Hooks class.
Definition: Hooks.php:34
MediaWiki\MediaWikiServices\forceGlobalInstance
static forceGlobalInstance(MediaWikiServices $services)
Replaces the global MediaWikiServices instance.
Definition: MediaWikiServices.php:146
ParserCache
In both all secondary updates will be triggered handle like object that caches derived data representing a and can trigger updates of cached copies of that e g in the links the ParserCache
Definition: pageupdater.txt:78
MediaWiki\MediaWikiServices\getStatsdDataFactory
getStatsdDataFactory()
Definition: MediaWikiServices.php:862
MediaWiki\MediaWikiServices\getNameTableStoreFactory
getNameTableStoreFactory()
Definition: MediaWikiServices.php:670