X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2FServiceWiring.php;h=ace64ab9286a46f4ffd71827baa979a6f45700d3;hb=f7d107e3a35f624d6f4caeac488e3c4681fbed7b;hp=f97d60df02816ce60d1419fa226140e367f869f0;hpb=4f4a620f8e5993f2c1ae8f2afbb999e42ee77471;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index f97d60df02..ace64ab928 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -404,24 +404,8 @@ return [ }, 'LocalServerObjectCache' => function ( MediaWikiServices $services ) { - $mainConfig = $services->getMainConfig(); - - if ( function_exists( 'apc_fetch' ) ) { - $id = 'apc'; - } elseif ( function_exists( 'apcu_fetch' ) ) { - $id = 'apcu'; - } elseif ( function_exists( 'wincache_ucache_get' ) ) { - $id = 'wincache'; - } else { - $id = CACHE_NONE; - } - - if ( !isset( $mainConfig->get( 'ObjectCaches' )[$id] ) ) { - throw new UnexpectedValueException( - "Cache type \"$id\" is not present in \$wgObjectCaches." ); - } - - return \ObjectCache::newFromParams( $mainConfig->get( 'ObjectCaches' )[$id] ); + $cacheId = \ObjectCache::detectLocalServerCache(); + return \ObjectCache::newFromId( $cacheId ); }, 'VirtualRESTServiceClient' => function ( MediaWikiServices $services ) { @@ -431,9 +415,7 @@ return [ foreach ( $config['paths'] as $prefix => $serviceConfig ) { $class = $serviceConfig['class']; // Merge in the global defaults - $constructArg = isset( $serviceConfig['options'] ) - ? $serviceConfig['options'] - : []; + $constructArg = $serviceConfig['options'] ?? []; $constructArg += $config['global']; // Make the VRS service available at the mount point $vrsClient->mount( $prefix, [ 'class' => $class, 'config' => $constructArg ] );