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