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