Merge "Make GenderCache use MediaWikiServices"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 11 May 2016 00:25:42 +0000 (00:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 11 May 2016 00:25:42 +0000 (00:25 +0000)
1  2 
includes/MediaWikiServices.php

@@@ -4,6 -4,7 +4,7 @@@ namespace MediaWiki
  use Config;
  use ConfigFactory;
  use EventRelayerGroup;
+ use GenderCache;
  use GlobalVarConfig;
  use Hooks;
  use LBFactory;
@@@ -66,8 -67,6 +67,8 @@@ class MediaWikiServices extends Service
        /**
         * Returns the global default instance of the top level service locator.
         *
 +       * @since 1.27
 +       *
         * The default instance is initialized using the service instantiator functions
         * defined in ServiceWiring.php.
         *
@@@ -93,8 -92,6 +94,8 @@@
        /**
         * Replaces the global MediaWikiServices instance.
         *
 +       * @since 1.28
 +       *
         * @note This is for use in PHPUnit tests only!
         *
         * @throws MWException if called outside of PHPUnit tests.
         * instance. getInstance() will return a different MediaWikiServices object
         * after every call to resetGlobalServiceLocator().
         *
 +       * @since 1.28
 +       *
         * @warning This should not be used during normal operation. It is intended for use
         * when the configuration has changed significantly since bootstrap time, e.g.
         * during the installation process or during testing.
         * storage layer will result in an error. Use resetGlobalInstance() to restore normal
         * operation.
         *
 +       * @since 1.28
 +       *
         * @warning This is intended for extreme situations only and should never be used
         * while serving normal web requests. Legitimate use cases for this method include
         * the installation process. Test fixtures may also use this, if the fixture relies
         * returns from after pcntl_fork(). It's also safe, but generally unnecessary,
         * to call this method from the parent process.
         *
 +       * @since 1.28
 +       *
         * @note This is intended for use in the context of process forking only!
         *
         * @see resetGlobalInstance()
        /**
         * Resets the given service for testing purposes.
         *
 +       * @since 1.28
 +       *
         * @warning This is generally unsafe! Other services may still retain references
         * to the stale service instance, leading to failures and inconsistencies. Subclasses
         * may use this method to reset specific services under specific instances, but
         * resetting of global services is allowed. In general, services should not be reset
         * individually, since that may introduce inconsistencies.
         *
 +       * @since 1.28
 +       *
         * This method will throw an exception if:
         *
         * - self::$resetInProgress is false (to allow all services to be reset together
         * when creating the MainConfig service. Application logic should
         * use getMainConfig() to get a Config instances.
         *
 +       * @since 1.27
         * @return Config
         */
        public function getBootstrapConfig() {
        }
  
        /**
 +       * @since 1.27
         * @return ConfigFactory
         */
        public function getConfigFactory() {
         * Returns the Config object that provides configuration for MediaWiki core.
         * This may or may not be the same object that is returned by getBootstrapConfig().
         *
 +       * @since 1.27
         * @return Config
         */
        public function getMainConfig() {
        }
  
        /**
 +       * @since 1.27
         * @return SiteLookup
         */
        public function getSiteLookup() {
        }
  
        /**
 +       * @since 1.27
         * @return SiteStore
         */
        public function getSiteStore() {
        }
  
        /**
 +       * @since 1.27
         * @return StatsdDataFactory
         */
        public function getStatsdDataFactory() {
        }
  
        /**
 +       * @since 1.27
         * @return EventRelayerGroup
         */
        public function getEventRelayerGroup() {
        }
  
        /**
 +       * @since 1.27
         * @return SearchEngine
         */
        public function newSearchEngine() {
        }
  
        /**
 +       * @since 1.27
         * @return SearchEngineFactory
         */
        public function getSearchEngineFactory() {
        }
  
        /**
 +       * @since 1.27
         * @return SearchEngineConfig
         */
        public function getSearchEngineConfig() {
        }
  
        /**
 +       * @since 1.27
         * @return SkinFactory
         */
        public function getSkinFactory() {
        }
  
        /**
 +       * @since 1.28
         * @return LBFactory
         */
        public function getDBLoadBalancerFactory() {
        }
  
        /**
 +       * @since 1.28
         * @return LoadBalancer The main DB load balancer for the local wiki.
         */
        public function getDBLoadBalancer() {
        }
  
        /**
 +       * @since 1.28
         * @return WatchedItemStore
         */
        public function getWatchedItemStore() {
                return $this->getService( 'WatchedItemStore' );
        }
  
+       /**
+        * @since 1.28
+        * @return GenderCache
+        */
+       public function getGenderCache() {
+               return $this->getService( 'GenderCache' );
+       }
        ///////////////////////////////////////////////////////////////////////////
        // NOTE: When adding a service getter here, don't forget to add a test
        // case for it in MediaWikiServicesTest::provideGetters() and in