15use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
104 private static $instance =
null;
121 if ( self::$instance ===
null ) {
127 self::$instance = self::newInstance( $bootstrapConfig,
'load' );
130 return self::$instance;
147 if ( !defined(
'MW_PHPUNIT_TEST' ) ) {
148 throw new MWException( __METHOD__ .
' must not be used outside unit tests.' );
151 $old = self::getInstance();
197 if ( self::$instance ===
null ) {
202 self::failIfResetNotAllowed( __METHOD__ );
204 if ( $bootstrapConfig ===
null ) {
205 $bootstrapConfig = self::$instance->getBootstrapConfig();
208 $oldInstance = self::$instance;
210 self::$instance = self::newInstance( $bootstrapConfig,
'load' );
211 self::$instance->importWiring( $oldInstance, [
'BootstrapConfig' ] );
213 if ( $quick ===
'quick' ) {
214 self::$instance->salvage( $oldInstance );
216 $oldInstance->destroy();
228 foreach ( $this->getServiceNames() as $name ) {
233 $oldService = $other->peekService( $name );
240 $newService = $this->getService( $name );
241 $newService->salvage( $oldService );
264 $instance =
new self( $bootstrapConfig );
267 if ( $loadWiring ===
'load' ) {
268 $wiringFiles = $bootstrapConfig->get(
'ServiceWiringFiles' );
269 $instance->loadWiringFiles( $wiringFiles );
273 Hooks::run(
'MediaWikiServices', [ $instance ] );
295 $destroy = [
'DBLoadBalancer',
'DBLoadBalancerFactory' ];
298 foreach ( $destroy as $name ) {
302 ObjectCache::clear();
320 self::resetGlobalInstance();
324 mt_srand( getmypid() );
349 if ( !defined(
'MW_PHPUNIT_TEST' ) && !defined(
'MW_PARSER_TEST' ) ) {
350 throw new MWException(
'resetServiceForTesting() must not be used outside unit tests.' );
353 $this->resetService( $name, $destroy );
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' )
390 throw new MWException( $method .
' may only be called during bootstrapping and unit tests!' );
400 parent::__construct();
403 $this->defineService(
'BootstrapConfig',
function () use ( $config ) {
415 return $this->getService(
'ActorMigration' );
423 return $this->getService(
'_SqlBlobStore' );
431 return $this->getService(
'BlobStoreFactory' );
448 return $this->getService(
'BootstrapConfig' );
456 return $this->getService(
'NameTableStoreFactory' )->getChangeTagDef();
464 return $this->getService(
'CommentStore' );
472 return $this->getService(
'ConfigFactory' );
480 return $this->getService(
'ConfigRepository' );
488 return $this->getService(
'ConfiguredReadOnlyMode' );
496 return $this->getService(
'ContentLanguage' );
504 return $this->getService(
'NameTableStoreFactory' )->getContentModels();
512 return $this->getService(
'CryptHKDF' );
521 return $this->getService(
'CryptRand' );
529 return $this->getService(
'DBLoadBalancer' );
537 return $this->getService(
'DBLoadBalancerFactory' );
545 return $this->getService(
'EventRelayerGroup' );
553 return $this->getService(
'ExternalStoreFactory' );
561 return $this->getService(
'GenderCache' );
569 return $this->getService(
'HttpRequestFactory' );
577 return $this->getService(
'InterwikiLookup' );
585 return $this->getService(
'LinkCache' );
596 return $this->getService(
'LinkRenderer' );
604 return $this->getService(
'LinkRendererFactory' );
612 return $this->getService(
'LocalServerObjectCache' );
620 return $this->getService(
'MagicWordFactory' );
631 return $this->getService(
'MainConfig' );
639 return $this->getService(
'MainObjectStash' );
647 return $this->getService(
'MainWANObjectCache' );
655 return $this->getService(
'MediaHandlerFactory' );
663 return $this->getService(
'MimeAnalyzer' );
671 return $this->getService(
'NameTableStoreFactory' );
678 return $this->getService(
'OldRevisionImporter' );
686 return $this->getService(
'Parser' );
694 return $this->getService(
'ParserCache' );
702 return $this->getService(
'ParserFactory' );
710 return $this->getService(
'PasswordFactory' );
718 return $this->getService(
'PerDbNameStatsdDataFactory' );
726 return $this->getService(
'PreferencesFactory' );
734 return $this->getService(
'ProxyLookup' );
742 return $this->getService(
'ReadOnlyMode' );
750 return $this->getService(
'RevisionFactory' );
758 return $this->getService(
'RevisionLookup' );
766 return $this->getService(
'RevisionRenderer' );
774 return $this->getService(
'RevisionStore' );
782 return $this->getService(
'RevisionStoreFactory' );
791 return $this->getService(
'SearchEngineFactory' )->create();
799 return $this->getService(
'SearchEngineConfig' );
807 return $this->getService(
'SearchEngineFactory' );
815 return $this->getService(
'ShellCommandFactory' );
823 return $this->getService(
'SiteLookup' );
831 return $this->getService(
'SiteStore' );
839 return $this->getService(
'SkinFactory' );
847 return $this->getService(
'NameTableStoreFactory' )->getSlotRoles();
855 return $this->getService(
'SpecialPageFactory' );
863 return $this->getService(
'StatsdDataFactory' );
871 return $this->getService(
'TitleFormatter' );
879 return $this->getService(
'TitleParser' );
887 return $this->getService(
'UploadRevisionImporter' );
895 return $this->getService(
'VirtualRESTServiceClient' );
903 return $this->getService(
'WatchedItemQueryService' );
911 return $this->getService(
'WatchedItemStore' );
919 return $this->getService(
'OldRevisionImporter' );
927 return $this->getService(
'WikiRevisionOldRevisionImporterNoUpdates' );
935 return $this->getService(
'UploadRevisionImporter' );
This class handles the logic for the actor table migration.
Factory class to create Config objects.
Factory class for spawning EventRelayer objects using configuration.
Caches user genders when needed to use correct namespace aliases.
Accesses configuration settings from $GLOBALS.
Cache for article titles (prefixed DB keys) and ids linked from one source.
A factory that stores information about MagicWords, and creates them on demand with caching.
Factory for handling the special page list and generating SpecialPage objects.
Functions to get cache objects.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Factory class for creating and checking Password objects.
Configuration handling class for SearchEngine.
Factory class for SearchEngine.
Contain a class for special pages.
Factory class to create Skin objects.
Virtual HTTP service client loosely styled after a Virtual File System.
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
returning false will NOT prevent logging $e
Interface for configuration instances.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
A title parser service for MediaWiki.