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