Use "break" instead of "continue"
[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 * @return CryptRand
543 */
544 public function getCryptRand() {
545 return $this->getService( 'CryptRand' );
546 }
547
548 /**
549 * @since 1.28
550 * @return CryptHKDF
551 */
552 public function getCryptHKDF() {
553 return $this->getService( 'CryptHKDF' );
554 }
555
556 /**
557 * @since 1.28
558 * @return MediaHandlerFactory
559 */
560 public function getMediaHandlerFactory() {
561 return $this->getService( 'MediaHandlerFactory' );
562 }
563
564 /**
565 * @since 1.28
566 * @return MimeAnalyzer
567 */
568 public function getMimeAnalyzer() {
569 return $this->getService( 'MimeAnalyzer' );
570 }
571
572 /**
573 * @since 1.28
574 * @return ProxyLookup
575 */
576 public function getProxyLookup() {
577 return $this->getService( 'ProxyLookup' );
578 }
579
580 /**
581 * @since 1.29
582 * @return Parser
583 */
584 public function getParser() {
585 return $this->getService( 'Parser' );
586 }
587
588 /**
589 * @since 1.30
590 * @return ParserCache
591 */
592 public function getParserCache() {
593 return $this->getService( 'ParserCache' );
594 }
595
596 /**
597 * @since 1.28
598 * @return GenderCache
599 */
600 public function getGenderCache() {
601 return $this->getService( 'GenderCache' );
602 }
603
604 /**
605 * @since 1.28
606 * @return LinkCache
607 */
608 public function getLinkCache() {
609 return $this->getService( 'LinkCache' );
610 }
611
612 /**
613 * @since 1.28
614 * @return LinkRendererFactory
615 */
616 public function getLinkRendererFactory() {
617 return $this->getService( 'LinkRendererFactory' );
618 }
619
620 /**
621 * LinkRenderer instance that can be used
622 * if no custom options are needed
623 *
624 * @since 1.28
625 * @return LinkRenderer
626 */
627 public function getLinkRenderer() {
628 return $this->getService( 'LinkRenderer' );
629 }
630
631 /**
632 * @since 1.28
633 * @return TitleFormatter
634 */
635 public function getTitleFormatter() {
636 return $this->getService( 'TitleFormatter' );
637 }
638
639 /**
640 * @since 1.28
641 * @return TitleParser
642 */
643 public function getTitleParser() {
644 return $this->getService( 'TitleParser' );
645 }
646
647 /**
648 * @since 1.28
649 * @return \BagOStuff
650 */
651 public function getMainObjectStash() {
652 return $this->getService( 'MainObjectStash' );
653 }
654
655 /**
656 * @since 1.28
657 * @return \WANObjectCache
658 */
659 public function getMainWANObjectCache() {
660 return $this->getService( 'MainWANObjectCache' );
661 }
662
663 /**
664 * @since 1.28
665 * @return \BagOStuff
666 */
667 public function getLocalServerObjectCache() {
668 return $this->getService( 'LocalServerObjectCache' );
669 }
670
671 /**
672 * @since 1.28
673 * @return VirtualRESTServiceClient
674 */
675 public function getVirtualRESTServiceClient() {
676 return $this->getService( 'VirtualRESTServiceClient' );
677 }
678
679 /**
680 * @since 1.29
681 * @return \ConfiguredReadOnlyMode
682 */
683 public function getConfiguredReadOnlyMode() {
684 return $this->getService( 'ConfiguredReadOnlyMode' );
685 }
686
687 /**
688 * @since 1.29
689 * @return \ReadOnlyMode
690 */
691 public function getReadOnlyMode() {
692 return $this->getService( 'ReadOnlyMode' );
693 }
694
695 /**
696 * @since 1.31
697 * @return \UploadRevisionImporter
698 */
699 public function getWikiRevisionUploadImporter() {
700 return $this->getService( 'UploadRevisionImporter' );
701 }
702
703 /**
704 * @since 1.31
705 * @return \OldRevisionImporter
706 */
707 public function getWikiRevisionOldRevisionImporter() {
708 return $this->getService( 'OldRevisionImporter' );
709 }
710
711 /**
712 * @since 1.31
713 * @return \OldRevisionImporter
714 */
715 public function getWikiRevisionOldRevisionImporterNoUpdates() {
716 return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
717 }
718
719 /**
720 * @since 1.30
721 * @return CommandFactory
722 */
723 public function getShellCommandFactory() {
724 return $this->getService( 'ShellCommandFactory' );
725 }
726
727 /**
728 * @since 1.31
729 * @return \ExternalStoreFactory
730 */
731 public function getExternalStoreFactory() {
732 return $this->getService( 'ExternalStoreFactory' );
733 }
734
735 /**
736 * @since 1.31
737 * @return BlobStoreFactory
738 */
739 public function getBlobStoreFactory() {
740 return $this->getService( 'BlobStoreFactory' );
741 }
742
743 /**
744 * @since 1.31
745 * @return BlobStore
746 */
747 public function getBlobStore() {
748 return $this->getService( '_SqlBlobStore' );
749 }
750
751 /**
752 * @since 1.31
753 * @return RevisionStore
754 */
755 public function getRevisionStore() {
756 return $this->getService( 'RevisionStore' );
757 }
758
759 /**
760 * @since 1.31
761 * @return RevisionLookup
762 */
763 public function getRevisionLookup() {
764 return $this->getService( 'RevisionLookup' );
765 }
766
767 /**
768 * @since 1.31
769 * @return RevisionFactory
770 */
771 public function getRevisionFactory() {
772 return $this->getService( 'RevisionFactory' );
773 }
774
775 /**
776 * @since 1.31
777 * @return NameTableStore
778 */
779 public function getContentModelStore() {
780 return $this->getService( 'ContentModelStore' );
781 }
782
783 /**
784 * @since 1.31
785 * @return NameTableStore
786 */
787 public function getSlotRoleStore() {
788 return $this->getService( 'SlotRoleStore' );
789 }
790
791 /**
792 * @since 1.31
793 * @return PreferencesFactory
794 */
795 public function getPreferencesFactory() {
796 return $this->getService( 'PreferencesFactory' );
797 }
798
799 /**
800 * @since 1.31
801 * @return HttpRequestFactory
802 */
803 public function getHttpRequestFactory() {
804 return $this->getService( 'HttpRequestFactory' );
805 }
806
807 /**
808 * @since 1.31
809 * @return CommentStore
810 */
811 public function getCommentStore() {
812 return $this->getService( 'CommentStore' );
813 }
814
815 /**
816 * @since 1.31
817 * @return ActorMigration
818 */
819 public function getActorMigration() {
820 return $this->getService( 'ActorMigration' );
821 }
822
823 ///////////////////////////////////////////////////////////////////////////
824 // NOTE: When adding a service getter here, don't forget to add a test
825 // case for it in MediaWikiServicesTest::provideGetters() and in
826 // MediaWikiServicesTest::provideGetService()!
827 ///////////////////////////////////////////////////////////////////////////
828
829 }