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