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