Turn ParserCache into a service, deprecate $parserMemc
[lhc/web/wiklou.git] / includes / MediaWikiServices.php
index b63c769..ea0ec15 100644 (file)
@@ -23,6 +23,7 @@ use MWException;
 use MimeAnalyzer;
 use ObjectCache;
 use Parser;
+use ParserCache;
 use ProxyLookup;
 use SearchEngine;
 use SearchEngineConfig;
@@ -377,7 +378,7 @@ class MediaWikiServices extends ServiceContainer {
                parent::__construct();
 
                // Register the given Config object as the bootstrap config service.
-               $this->defineService( 'BootstrapConfig', function() use ( $config ) {
+               $this->defineService( 'BootstrapConfig', function () use ( $config ) {
                        return $config;
                } );
        }
@@ -573,6 +574,14 @@ class MediaWikiServices extends ServiceContainer {
                return $this->getService( 'Parser' );
        }
 
+       /**
+        * @since 1.30
+        * @return ParserCache
+        */
+       public function getParserCache() {
+               return $this->getService( 'ParserCache' );
+       }
+
        /**
         * @since 1.28
         * @return GenderCache