Add ObjectFactory as a service
[lhc/web/wiklou.git] / includes / MediaWikiServices.php
index ec82f8e..1ffbf1d 100644 (file)
@@ -14,6 +14,7 @@ use GlobalVarConfig;
 use Hooks;
 use IBufferingStatsdDataFactory;
 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
+use LocalisationCache;
 use MediaWiki\Block\BlockManager;
 use MediaWiki\Block\BlockRestrictionStore;
 use MediaWiki\FileBackend\FSFile\TempFSFileFactory;
@@ -64,6 +65,7 @@ use SkinFactory;
 use TitleFormatter;
 use TitleParser;
 use VirtualRESTServiceClient;
+use Wikimedia\ObjectFactory;
 use Wikimedia\Rdbms\LBFactory;
 use Wikimedia\Services\SalvageableService;
 use Wikimedia\Services\ServiceContainer;
@@ -429,6 +431,14 @@ class MediaWikiServices extends ServiceContainer {
                return $this->getService( 'ActorMigration' );
        }
 
+       /**
+        * @since 1.34
+        * @return BadFileLookup
+        */
+       public function getBadFileLookup() : BadFileLookup {
+               return $this->getService( 'BadFileLookup' );
+       }
+
        /**
         * @since 1.31
         * @return BlobStore
@@ -641,6 +651,14 @@ class MediaWikiServices extends ServiceContainer {
                return $this->getService( 'LinkRendererFactory' );
        }
 
+       /**
+        * @since 1.34
+        * @return LocalisationCache
+        */
+       public function getLocalisationCache() : LocalisationCache {
+               return $this->getService( 'LocalisationCache' );
+       }
+
        /**
         * @since 1.28
         * @return \BagOStuff
@@ -732,6 +750,17 @@ class MediaWikiServices extends ServiceContainer {
                return $this->getService( 'NameTableStoreFactory' );
        }
 
+       /**
+        * ObjectFactory is intended for instantiating "handlers" from declarative definitions,
+        * such as Action API modules, special pages, or REST API handlers.
+        *
+        * @since 1.34
+        * @return ObjectFactory
+        */
+       public function getObjectFactory() {
+               return $this->getService( 'ObjectFactory' );
+       }
+
        /**
         * @since 1.32
         * @return OldRevisionImporter