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