Merge "Improve profileinfo.php documentation"
[lhc/web/wiklou.git] / includes / MediaWikiServices.php
1 <?php
2 namespace MediaWiki;
3
4 use ActorMigration;
5 use CommentStore;
6 use Config;
7 use ConfigFactory;
8 use CryptHKDF;
9 use CryptRand;
10 use EventRelayerGroup;
11 use GenderCache;
12 use GlobalVarConfig;
13 use Hooks;
14 use IBufferingStatsdDataFactory;
15 use MediaWiki\Http\HttpRequestFactory;
16 use MediaWiki\Preferences\PreferencesFactory;
17 use MediaWiki\Shell\CommandFactory;
18 use MediaWiki\Special\SpecialPageFactory;
19 use MediaWiki\Storage\BlobStore;
20 use MediaWiki\Storage\BlobStoreFactory;
21 use MediaWiki\Storage\NameTableStore;
22 use MediaWiki\Storage\RevisionFactory;
23 use MediaWiki\Storage\RevisionLookup;
24 use MediaWiki\Storage\RevisionStore;
25 use OldRevisionImporter;
26 use MediaWiki\Storage\RevisionStoreFactory;
27 use UploadRevisionImporter;
28 use Wikimedia\Rdbms\LBFactory;
29 use LinkCache;
30 use Wikimedia\Rdbms\LoadBalancer;
31 use MediaHandlerFactory;
32 use MediaWiki\Config\ConfigRepository;
33 use MediaWiki\Linker\LinkRenderer;
34 use MediaWiki\Linker\LinkRendererFactory;
35 use MediaWiki\Services\SalvageableService;
36 use MediaWiki\Services\ServiceContainer;
37 use MediaWiki\Services\NoSuchServiceException;
38 use MWException;
39 use MimeAnalyzer;
40 use ObjectCache;
41 use Parser;
42 use ParserCache;
43 use ParserFactory;
44 use PasswordFactory;
45 use ProxyLookup;
46 use SearchEngine;
47 use SearchEngineConfig;
48 use SearchEngineFactory;
49 use SiteLookup;
50 use SiteStore;
51 use WatchedItemStoreInterface;
52 use WatchedItemQueryService;
53 use SkinFactory;
54 use TitleFormatter;
55 use TitleParser;
56 use VirtualRESTServiceClient;
57 use MediaWiki\Interwiki\InterwikiLookup;
58 use MagicWordFactory;
59
60 /**
61 * Service locator for MediaWiki core services.
62 *
63 * This program is free software; you can redistribute it and/or modify
64 * it under the terms of the GNU General Public License as published by
65 * the Free Software Foundation; either version 2 of the License, or
66 * (at your option) any later version.
67 *
68 * This program is distributed in the hope that it will be useful,
69 * but WITHOUT ANY WARRANTY; without even the implied warranty of
70 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71 * GNU General Public License for more details.
72 *
73 * You should have received a copy of the GNU General Public License along
74 * with this program; if not, write to the Free Software Foundation, Inc.,
75 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
76 * http://www.gnu.org/copyleft/gpl.html
77 *
78 * @file
79 *
80 * @since 1.27
81 */
82
83 /**
84 * MediaWikiServices is the service locator for the application scope of MediaWiki.
85 * Its implemented as a simple configurable DI container.
86 * MediaWikiServices acts as a top level factory/registry for top level services, and builds
87 * the network of service objects that defines MediaWiki's application logic.
88 * It acts as an entry point to MediaWiki's dependency injection mechanism.
89 *
90 * Services are defined in the "wiring" array passed to the constructor,
91 * or by calling defineService().
92 *
93 * @see docs/injection.txt for an overview of using dependency injection in the
94 * MediaWiki code base.
95 */
96 class MediaWikiServices extends ServiceContainer {
97
98 /**
99 * @var MediaWikiServices|null
100 */
101 private static $instance = null;
102
103 /**
104 * Returns the global default instance of the top level service locator.
105 *
106 * @since 1.27
107 *
108 * The default instance is initialized using the service instantiator functions
109 * defined in ServiceWiring.php.
110 *
111 * @note This should only be called by static functions! The instance returned here
112 * should not be passed around! Objects that need access to a service should have
113 * that service injected into the constructor, never a service locator!
114 *
115 * @return MediaWikiServices
116 */
117 public static function getInstance() {
118 if ( self::$instance === null ) {
119 // NOTE: constructing GlobalVarConfig here is not particularly pretty,
120 // but some information from the global scope has to be injected here,
121 // even if it's just a file name or database credentials to load
122 // configuration from.
123 $bootstrapConfig = new GlobalVarConfig();
124 self::$instance = self::newInstance( $bootstrapConfig, 'load' );
125 }
126
127 return self::$instance;
128 }
129
130 /**
131 * Replaces the global MediaWikiServices instance.
132 *
133 * @since 1.28
134 *
135 * @note This is for use in PHPUnit tests only!
136 *
137 * @throws MWException if called outside of PHPUnit tests.
138 *
139 * @param MediaWikiServices $services The new MediaWikiServices object.
140 *
141 * @return MediaWikiServices The old MediaWikiServices object, so it can be restored later.
142 */
143 public static function forceGlobalInstance( MediaWikiServices $services ) {
144 if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
145 throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
146 }
147
148 $old = self::getInstance();
149 self::$instance = $services;
150
151 return $old;
152 }
153
154 /**
155 * Creates a new instance of MediaWikiServices and sets it as the global default
156 * instance. getInstance() will return a different MediaWikiServices object
157 * after every call to resetGlobalInstance().
158 *
159 * @since 1.28
160 *
161 * @warning This should not be used during normal operation. It is intended for use
162 * when the configuration has changed significantly since bootstrap time, e.g.
163 * during the installation process or during testing.
164 *
165 * @warning Calling resetGlobalInstance() may leave the application in an inconsistent
166 * state. Calling this is only safe under the ASSUMPTION that NO REFERENCE to
167 * any of the services managed by MediaWikiServices exist. If any service objects
168 * managed by the old MediaWikiServices instance remain in use, they may INTERFERE
169 * with the operation of the services managed by the new MediaWikiServices.
170 * Operating with a mix of services created by the old and the new
171 * MediaWikiServices instance may lead to INCONSISTENCIES and even DATA LOSS!
172 * Any class implementing LAZY LOADING is especially prone to this problem,
173 * since instances would typically retain a reference to a storage layer service.
174 *
175 * @see forceGlobalInstance()
176 * @see resetGlobalInstance()
177 * @see resetBetweenTest()
178 *
179 * @param Config|null $bootstrapConfig The Config object to be registered as the
180 * 'BootstrapConfig' service. This has to contain at least the information
181 * needed to set up the 'ConfigFactory' service. If not given, the bootstrap
182 * config of the old instance of MediaWikiServices will be re-used. If there
183 * was no previous instance, a new GlobalVarConfig object will be used to
184 * bootstrap the services.
185 *
186 * @param string $quick Set this to "quick" to allow expensive resources to be re-used.
187 * See SalvageableService for details.
188 *
189 * @throws MWException If called after MW_SERVICE_BOOTSTRAP_COMPLETE has been defined in
190 * Setup.php (unless MW_PHPUNIT_TEST or MEDIAWIKI_INSTALL or RUN_MAINTENANCE_IF_MAIN
191 * is defined).
192 */
193 public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
194 if ( self::$instance === null ) {
195 // no global instance yet, nothing to reset
196 return;
197 }
198
199 self::failIfResetNotAllowed( __METHOD__ );
200
201 if ( $bootstrapConfig === null ) {
202 $bootstrapConfig = self::$instance->getBootstrapConfig();
203 }
204
205 $oldInstance = self::$instance;
206
207 self::$instance = self::newInstance( $bootstrapConfig, 'load' );
208 self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
209
210 if ( $quick === 'quick' ) {
211 self::$instance->salvage( $oldInstance );
212 } else {
213 $oldInstance->destroy();
214 }
215 }
216
217 /**
218 * Salvages the state of any salvageable service instances in $other.
219 *
220 * @note $other will have been destroyed when salvage() returns.
221 *
222 * @param MediaWikiServices $other
223 */
224 private function salvage( self $other ) {
225 foreach ( $this->getServiceNames() as $name ) {
226 // The service could be new in the new instance and not registered in the
227 // other instance (e.g. an extension that was loaded after the instantiation of
228 // the other instance. Skip this service in this case. See T143974
229 try {
230 $oldService = $other->peekService( $name );
231 } catch ( NoSuchServiceException $e ) {
232 continue;
233 }
234
235 if ( $oldService instanceof SalvageableService ) {
236 /** @var SalvageableService $newService */
237 $newService = $this->getService( $name );
238 $newService->salvage( $oldService );
239 }
240 }
241
242 $other->destroy();
243 }
244
245 /**
246 * Creates a new MediaWikiServices instance and initializes it according to the
247 * given $bootstrapConfig. In particular, all wiring files defined in the
248 * ServiceWiringFiles setting are loaded, and the MediaWikiServices hook is called.
249 *
250 * @param Config|null $bootstrapConfig The Config object to be registered as the
251 * 'BootstrapConfig' service.
252 *
253 * @param string $loadWiring set this to 'load' to load the wiring files specified
254 * in the 'ServiceWiringFiles' setting in $bootstrapConfig.
255 *
256 * @return MediaWikiServices
257 * @throws MWException
258 * @throws \FatalError
259 */
260 private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
261 $instance = new self( $bootstrapConfig );
262
263 // Load the default wiring from the specified files.
264 if ( $loadWiring === 'load' ) {
265 $wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
266 $instance->loadWiringFiles( $wiringFiles );
267 }
268
269 // Provide a traditional hook point to allow extensions to configure services.
270 Hooks::run( 'MediaWikiServices', [ $instance ] );
271
272 return $instance;
273 }
274
275 /**
276 * Disables all storage layer services. After calling this, any attempt to access the
277 * storage layer will result in an error. Use resetGlobalInstance() to restore normal
278 * operation.
279 *
280 * @since 1.28
281 *
282 * @warning This is intended for extreme situations only and should never be used
283 * while serving normal web requests. Legitimate use cases for this method include
284 * the installation process. Test fixtures may also use this, if the fixture relies
285 * on globalState.
286 *
287 * @see resetGlobalInstance()
288 * @see resetChildProcessServices()
289 */
290 public static function disableStorageBackend() {
291 // TODO: also disable some Caches, JobQueues, etc
292 $destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
293 $services = self::getInstance();
294
295 foreach ( $destroy as $name ) {
296 $services->disableService( $name );
297 }
298
299 ObjectCache::clear();
300 }
301
302 /**
303 * Resets any services that may have become stale after a child process
304 * returns from after pcntl_fork(). It's also safe, but generally unnecessary,
305 * to call this method from the parent process.
306 *
307 * @since 1.28
308 *
309 * @note This is intended for use in the context of process forking only!
310 *
311 * @see resetGlobalInstance()
312 * @see disableStorageBackend()
313 */
314 public static function resetChildProcessServices() {
315 // NOTE: for now, just reset everything. Since we don't know the interdependencies
316 // between services, we can't do this more selectively at this time.
317 self::resetGlobalInstance();
318
319 // Child, reseed because there is no bug in PHP:
320 // https://bugs.php.net/bug.php?id=42465
321 mt_srand( getmypid() );
322 }
323
324 /**
325 * Resets the given service for testing purposes.
326 *
327 * @since 1.28
328 *
329 * @warning This is generally unsafe! Other services may still retain references
330 * to the stale service instance, leading to failures and inconsistencies. Subclasses
331 * may use this method to reset specific services under specific instances, but
332 * it should not be exposed to application logic.
333 *
334 * @note With proper dependency injection used throughout the codebase, this method
335 * should not be needed. It is provided to allow tests that pollute global service
336 * instances to clean up.
337 *
338 * @param string $name
339 * @param bool $destroy Whether the service instance should be destroyed if it exists.
340 * When set to false, any existing service instance will effectively be detached
341 * from the container.
342 *
343 * @throws MWException if called outside of PHPUnit tests.
344 */
345 public function resetServiceForTesting( $name, $destroy = true ) {
346 if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
347 throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
348 }
349
350 $this->resetService( $name, $destroy );
351 }
352
353 /**
354 * Convenience method that throws an exception unless it is called during a phase in which
355 * resetting of global services is allowed. In general, services should not be reset
356 * individually, since that may introduce inconsistencies.
357 *
358 * @since 1.28
359 *
360 * This method will throw an exception if:
361 *
362 * - self::$resetInProgress is false (to allow all services to be reset together
363 * via resetGlobalInstance)
364 * - and MEDIAWIKI_INSTALL is not defined (to allow services to be reset during installation)
365 * - and MW_PHPUNIT_TEST is not defined (to allow services to be reset during testing)
366 *
367 * This method is intended to be used to safeguard against accidentally resetting
368 * global service instances that are not yet managed by MediaWikiServices. It is
369 * defined here in the MediaWikiServices services class to have a central place
370 * for managing service bootstrapping and resetting.
371 *
372 * @param string $method the name of the caller method, as given by __METHOD__.
373 *
374 * @throws MWException if called outside bootstrap mode.
375 *
376 * @see resetGlobalInstance()
377 * @see forceGlobalInstance()
378 * @see disableStorageBackend()
379 */
380 public static function failIfResetNotAllowed( $method ) {
381 if ( !defined( 'MW_PHPUNIT_TEST' )
382 && !defined( 'MW_PARSER_TEST' )
383 && !defined( 'MEDIAWIKI_INSTALL' )
384 && !defined( 'RUN_MAINTENANCE_IF_MAIN' )
385 && defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
386 ) {
387 throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
388 }
389 }
390
391 /**
392 * @param Config $config The Config object to be registered as the 'BootstrapConfig' service.
393 * This has to contain at least the information needed to set up the 'ConfigFactory'
394 * service.
395 */
396 public function __construct( Config $config ) {
397 parent::__construct();
398
399 // Register the given Config object as the bootstrap config service.
400 $this->defineService( 'BootstrapConfig', function () use ( $config ) {
401 return $config;
402 } );
403 }
404
405 // CONVENIENCE GETTERS ////////////////////////////////////////////////////
406
407 /**
408 * @since 1.31
409 * @return ActorMigration
410 */
411 public function getActorMigration() {
412 return $this->getService( 'ActorMigration' );
413 }
414
415 /**
416 * @since 1.31
417 * @return BlobStore
418 */
419 public function getBlobStore() {
420 return $this->getService( '_SqlBlobStore' );
421 }
422
423 /**
424 * @since 1.31
425 * @return BlobStoreFactory
426 */
427 public function getBlobStoreFactory() {
428 return $this->getService( 'BlobStoreFactory' );
429 }
430
431 /**
432 * Returns the Config object containing the bootstrap configuration.
433 * Bootstrap configuration would typically include database credentials
434 * and other information that may be needed before the ConfigFactory
435 * service can be instantiated.
436 *
437 * @note This should only be used during bootstrapping, in particular
438 * when creating the MainConfig service. Application logic should
439 * use getMainConfig() to get a Config instances.
440 *
441 * @since 1.27
442 * @return Config
443 */
444 public function getBootstrapConfig() {
445 return $this->getService( 'BootstrapConfig' );
446 }
447
448 /**
449 * @since 1.32
450 * @return NameTableStore
451 */
452 public function getChangeTagDefStore() {
453 return $this->getService( 'ChangeTagDefStore' );
454 }
455
456 /**
457 * @since 1.31
458 * @return CommentStore
459 */
460 public function getCommentStore() {
461 return $this->getService( 'CommentStore' );
462 }
463
464 /**
465 * @since 1.27
466 * @return ConfigFactory
467 */
468 public function getConfigFactory() {
469 return $this->getService( 'ConfigFactory' );
470 }
471
472 /**
473 * @since 1.32
474 * @return ConfigRepository
475 */
476 public function getConfigRepository() {
477 return $this->getService( 'ConfigRepository' );
478 }
479
480 /**
481 * @since 1.29
482 * @return \ConfiguredReadOnlyMode
483 */
484 public function getConfiguredReadOnlyMode() {
485 return $this->getService( 'ConfiguredReadOnlyMode' );
486 }
487
488 /**
489 * @since 1.32
490 * @return \Language
491 */
492 public function getContentLanguage() {
493 return $this->getService( 'ContentLanguage' );
494 }
495
496 /**
497 * @since 1.31
498 * @return NameTableStore
499 */
500 public function getContentModelStore() {
501 return $this->getService( 'ContentModelStore' );
502 }
503
504 /**
505 * @since 1.28
506 * @return CryptHKDF
507 */
508 public function getCryptHKDF() {
509 return $this->getService( 'CryptHKDF' );
510 }
511
512 /**
513 * @since 1.28
514 * @deprecated since 1.32, use random_bytes()/random_int()
515 * @return CryptRand
516 */
517 public function getCryptRand() {
518 return $this->getService( 'CryptRand' );
519 }
520
521 /**
522 * @since 1.28
523 * @return LoadBalancer The main DB load balancer for the local wiki.
524 */
525 public function getDBLoadBalancer() {
526 return $this->getService( 'DBLoadBalancer' );
527 }
528
529 /**
530 * @since 1.28
531 * @return LBFactory
532 */
533 public function getDBLoadBalancerFactory() {
534 return $this->getService( 'DBLoadBalancerFactory' );
535 }
536
537 /**
538 * @since 1.27
539 * @return EventRelayerGroup
540 */
541 public function getEventRelayerGroup() {
542 return $this->getService( 'EventRelayerGroup' );
543 }
544
545 /**
546 * @since 1.31
547 * @return \ExternalStoreFactory
548 */
549 public function getExternalStoreFactory() {
550 return $this->getService( 'ExternalStoreFactory' );
551 }
552
553 /**
554 * @since 1.28
555 * @return GenderCache
556 */
557 public function getGenderCache() {
558 return $this->getService( 'GenderCache' );
559 }
560
561 /**
562 * @since 1.31
563 * @return HttpRequestFactory
564 */
565 public function getHttpRequestFactory() {
566 return $this->getService( 'HttpRequestFactory' );
567 }
568
569 /**
570 * @since 1.28
571 * @return InterwikiLookup
572 */
573 public function getInterwikiLookup() {
574 return $this->getService( 'InterwikiLookup' );
575 }
576
577 /**
578 * @since 1.28
579 * @return LinkCache
580 */
581 public function getLinkCache() {
582 return $this->getService( 'LinkCache' );
583 }
584
585 /**
586 * LinkRenderer instance that can be used
587 * if no custom options are needed
588 *
589 * @since 1.28
590 * @return LinkRenderer
591 */
592 public function getLinkRenderer() {
593 return $this->getService( 'LinkRenderer' );
594 }
595
596 /**
597 * @since 1.28
598 * @return LinkRendererFactory
599 */
600 public function getLinkRendererFactory() {
601 return $this->getService( 'LinkRendererFactory' );
602 }
603
604 /**
605 * @since 1.28
606 * @return \BagOStuff
607 */
608 public function getLocalServerObjectCache() {
609 return $this->getService( 'LocalServerObjectCache' );
610 }
611
612 /**
613 * @since 1.32
614 * @return MagicWordFactory
615 */
616 public function getMagicWordFactory() {
617 return $this->getService( 'MagicWordFactory' );
618 }
619
620 /**
621 * Returns the Config object that provides configuration for MediaWiki core.
622 * This may or may not be the same object that is returned by getBootstrapConfig().
623 *
624 * @since 1.27
625 * @return Config
626 */
627 public function getMainConfig() {
628 return $this->getService( 'MainConfig' );
629 }
630
631 /**
632 * @since 1.28
633 * @return \BagOStuff
634 */
635 public function getMainObjectStash() {
636 return $this->getService( 'MainObjectStash' );
637 }
638
639 /**
640 * @since 1.28
641 * @return \WANObjectCache
642 */
643 public function getMainWANObjectCache() {
644 return $this->getService( 'MainWANObjectCache' );
645 }
646
647 /**
648 * @since 1.28
649 * @return MediaHandlerFactory
650 */
651 public function getMediaHandlerFactory() {
652 return $this->getService( 'MediaHandlerFactory' );
653 }
654
655 /**
656 * @since 1.28
657 * @return MimeAnalyzer
658 */
659 public function getMimeAnalyzer() {
660 return $this->getService( 'MimeAnalyzer' );
661 }
662
663 /**
664 * @since 1.32
665 * @return OldRevisionImporter
666 */
667 public function getOldRevisionImporter() {
668 return $this->getService( 'OldRevisionImporter' );
669 }
670
671 /**
672 * @since 1.29
673 * @return Parser
674 */
675 public function getParser() {
676 return $this->getService( 'Parser' );
677 }
678
679 /**
680 * @since 1.30
681 * @return ParserCache
682 */
683 public function getParserCache() {
684 return $this->getService( 'ParserCache' );
685 }
686
687 /**
688 * @since 1.32
689 * @return ParserFactory
690 */
691 public function getParserFactory() {
692 return $this->getService( 'ParserFactory' );
693 }
694
695 /**
696 * @since 1.32
697 * @return PasswordFactory
698 */
699 public function getPasswordFactory() {
700 return $this->getService( 'PasswordFactory' );
701 }
702
703 /**
704 * @since 1.32
705 * @return IBufferingStatsdDataFactory
706 */
707 public function getPerDbNameStatsdDataFactory() {
708 return $this->getService( 'PerDbNameStatsdDataFactory' );
709 }
710
711 /**
712 * @since 1.31
713 * @return PreferencesFactory
714 */
715 public function getPreferencesFactory() {
716 return $this->getService( 'PreferencesFactory' );
717 }
718
719 /**
720 * @since 1.28
721 * @return ProxyLookup
722 */
723 public function getProxyLookup() {
724 return $this->getService( 'ProxyLookup' );
725 }
726
727 /**
728 * @since 1.29
729 * @return \ReadOnlyMode
730 */
731 public function getReadOnlyMode() {
732 return $this->getService( 'ReadOnlyMode' );
733 }
734
735 /**
736 * @since 1.31
737 * @return RevisionFactory
738 */
739 public function getRevisionFactory() {
740 return $this->getService( 'RevisionFactory' );
741 }
742
743 /**
744 * @since 1.31
745 * @return RevisionLookup
746 */
747 public function getRevisionLookup() {
748 return $this->getService( 'RevisionLookup' );
749 }
750
751 /**
752 * @since 1.31
753 * @return RevisionStore
754 */
755 public function getRevisionStore() {
756 return $this->getService( 'RevisionStore' );
757 }
758
759 /**
760 * @since 1.32
761 * @return RevisionStoreFactory
762 */
763 public function getRevisionStoreFactory() {
764 return $this->getService( 'RevisionStoreFactory' );
765 }
766
767 /**
768 * @since 1.27
769 * @return SearchEngine
770 */
771 public function newSearchEngine() {
772 // New engine object every time, since they keep state
773 return $this->getService( 'SearchEngineFactory' )->create();
774 }
775
776 /**
777 * @since 1.27
778 * @return SearchEngineConfig
779 */
780 public function getSearchEngineConfig() {
781 return $this->getService( 'SearchEngineConfig' );
782 }
783
784 /**
785 * @since 1.27
786 * @return SearchEngineFactory
787 */
788 public function getSearchEngineFactory() {
789 return $this->getService( 'SearchEngineFactory' );
790 }
791
792 /**
793 * @since 1.30
794 * @return CommandFactory
795 */
796 public function getShellCommandFactory() {
797 return $this->getService( 'ShellCommandFactory' );
798 }
799
800 /**
801 * @since 1.27
802 * @return SiteLookup
803 */
804 public function getSiteLookup() {
805 return $this->getService( 'SiteLookup' );
806 }
807
808 /**
809 * @since 1.27
810 * @return SiteStore
811 */
812 public function getSiteStore() {
813 return $this->getService( 'SiteStore' );
814 }
815
816 /**
817 * @since 1.27
818 * @return SkinFactory
819 */
820 public function getSkinFactory() {
821 return $this->getService( 'SkinFactory' );
822 }
823
824 /**
825 * @since 1.31
826 * @return NameTableStore
827 */
828 public function getSlotRoleStore() {
829 return $this->getService( 'SlotRoleStore' );
830 }
831
832 /**
833 * @since 1.32
834 * @return SpecialPageFactory
835 */
836 public function getSpecialPageFactory() : SpecialPageFactory {
837 return $this->getService( 'SpecialPageFactory' );
838 }
839
840 /**
841 * @since 1.27
842 * @return IBufferingStatsdDataFactory
843 */
844 public function getStatsdDataFactory() {
845 return $this->getService( 'StatsdDataFactory' );
846 }
847
848 /**
849 * @since 1.28
850 * @return TitleFormatter
851 */
852 public function getTitleFormatter() {
853 return $this->getService( 'TitleFormatter' );
854 }
855
856 /**
857 * @since 1.28
858 * @return TitleParser
859 */
860 public function getTitleParser() {
861 return $this->getService( 'TitleParser' );
862 }
863
864 /**
865 * @since 1.32
866 * @return UploadRevisionImporter
867 */
868 public function getUploadRevisionImporter() {
869 return $this->getService( 'UploadRevisionImporter' );
870 }
871
872 /**
873 * @since 1.28
874 * @return VirtualRESTServiceClient
875 */
876 public function getVirtualRESTServiceClient() {
877 return $this->getService( 'VirtualRESTServiceClient' );
878 }
879
880 /**
881 * @since 1.28
882 * @return WatchedItemQueryService
883 */
884 public function getWatchedItemQueryService() {
885 return $this->getService( 'WatchedItemQueryService' );
886 }
887
888 /**
889 * @since 1.28
890 * @return WatchedItemStoreInterface
891 */
892 public function getWatchedItemStore() {
893 return $this->getService( 'WatchedItemStore' );
894 }
895
896 /**
897 * @since 1.31
898 * @return \OldRevisionImporter
899 */
900 public function getWikiRevisionOldRevisionImporter() {
901 return $this->getService( 'OldRevisionImporter' );
902 }
903
904 /**
905 * @since 1.31
906 * @return \OldRevisionImporter
907 */
908 public function getWikiRevisionOldRevisionImporterNoUpdates() {
909 return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
910 }
911
912 /**
913 * @since 1.31
914 * @return \UploadRevisionImporter
915 */
916 public function getWikiRevisionUploadImporter() {
917 return $this->getService( 'UploadRevisionImporter' );
918 }
919
920 }