X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FObjectCache.php;h=5e99ac9d701323547e4d464f0b063bb8e6526592;hb=72fa557f45ce6640bd13e82c7130ad7934d8c384;hp=3bb077173f3b1a85b0cda25f24cd3e0be771f0aa;hpb=b4c7f4c30db86ad74b068afc56a13a965c369540;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 3bb077173f..5e99ac9d70 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -119,7 +119,7 @@ class ObjectCache { * @return BagOStuff * @throws InvalidArgumentException */ - public static function newFromId( $id ) { + private static function newFromId( $id ) { global $wgObjectCaches; if ( !isset( $wgObjectCaches[$id] ) ) { @@ -146,7 +146,7 @@ class ObjectCache { * * @return string */ - public static function getDefaultKeyspace() { + private static function getDefaultKeyspace() { global $wgCachePrefix; $keyspace = $wgCachePrefix; @@ -204,9 +204,6 @@ class ObjectCache { if ( !isset( $params['servers'] ) ) { $params['servers'] = $GLOBALS['wgMemCachedServers']; } - if ( !isset( $params['debug'] ) ) { - $params['debug'] = $GLOBALS['wgMemCachedDebug']; - } if ( !isset( $params['persistent'] ) ) { $params['persistent'] = $GLOBALS['wgMemCachedPersistent']; } @@ -297,7 +294,7 @@ class ObjectCache { * @return WANObjectCache * @throws UnexpectedValueException */ - public static function newWANCacheFromId( $id ) { + private static function newWANCacheFromId( $id ) { global $wgWANObjectCaches, $wgObjectCaches; if ( !isset( $wgWANObjectCaches[$id] ) ) { @@ -322,6 +319,7 @@ class ObjectCache { * @param array $params * @return WANObjectCache * @throws UnexpectedValueException + * @suppress PhanTypeMismatchReturn */ public static function newWANCacheFromParams( array $params ) { global $wgCommandLineMode, $wgSecretKey; @@ -393,12 +391,19 @@ class ObjectCache { */ public static function detectLocalServerCache() { if ( function_exists( 'apcu_fetch' ) ) { - return 'apcu'; + // Make sure the APCu methods actually store anything + if ( PHP_SAPI !== 'cli' || ini_get( 'apc.enable_cli' ) ) { + return 'apcu'; + } } elseif ( function_exists( 'apc_fetch' ) ) { - return 'apc'; + // Make sure the APC methods actually store anything + if ( PHP_SAPI !== 'cli' || ini_get( 'apc.enable_cli' ) ) { + return 'apc'; + } } elseif ( function_exists( 'wincache_ucache_get' ) ) { return 'wincache'; } + return CACHE_NONE; } }