Merge "RCFilters: define consistent interface in ChangesListFilterGroup"
[lhc/web/wiklou.git] / includes / ServiceWiring.php
index 2dfcc42..75ce8ec 100644 (file)
@@ -41,6 +41,7 @@ use MediaWiki\Interwiki\ClassicInterwikiLookup;
 use MediaWiki\Linker\LinkRendererFactory;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Shell\CommandFactory;
 
 return [
        'DBLoadBalancerFactory' => function ( MediaWikiServices $services ) {
@@ -287,6 +288,17 @@ return [
                return ObjectFactory::constructClassInstance( $conf['class'], [ $conf ] );
        },
 
+       'ParserCache' => function ( MediaWikiServices $services ) {
+               $config = $services->getMainConfig();
+               $cache = ObjectCache::getInstance( $config->get( 'ParserCacheType' ) );
+               wfDebugLog( 'caches', 'parser: ' . get_class( $cache ) );
+
+               return new ParserCache(
+                       $cache,
+                       $config->get( 'CacheEpoch' )
+               );
+       },
+
        'LinkCache' => function ( MediaWikiServices $services ) {
                return new LinkCache(
                        $services->getTitleFormatter(),
@@ -417,6 +429,23 @@ return [
                );
        },
 
+       'ShellCommandFactory' => function ( MediaWikiServices $services ) {
+               $config = $services->getMainConfig();
+
+               $limits = [
+                       'time' => $config->get( 'MaxShellTime' ),
+                       'walltime' => $config->get( 'MaxShellWallClockTime' ),
+                       'memory' => $config->get( 'MaxShellMemory' ),
+                       'filesize' => $config->get( 'MaxShellFileSize' ),
+               ];
+               $cgroup = $config->get( 'ShellCgroup' );
+
+               $factory = new CommandFactory( $limits, $cgroup );
+               $factory->setLogger( LoggerFactory::getInstance( 'exec' ) );
+
+               return $factory;
+       },
+
        ///////////////////////////////////////////////////////////////////////////
        // NOTE: When adding a service here, don't forget to add a getter function
        // in the MediaWikiServices class. The convenience getter should just call