dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make ObjectCache check the value of apc.enable_cli in CLI mode
[lhc/web/wiklou.git]
/
includes
/
objectcache
/
ObjectCache.php
diff --git
a/includes/objectcache/ObjectCache.php
b/includes/objectcache/ObjectCache.php
index
ffbc378
..
f1a96c8
100644
(file)
--- a/
includes/objectcache/ObjectCache.php
+++ b/
includes/objectcache/ObjectCache.php
@@
-119,7
+119,7
@@
class ObjectCache {
* @return BagOStuff
* @throws InvalidArgumentException
*/
* @return BagOStuff
* @throws InvalidArgumentException
*/
- p
ublic
static function newFromId( $id ) {
+ p
rivate
static function newFromId( $id ) {
global $wgObjectCaches;
if ( !isset( $wgObjectCaches[$id] ) ) {
global $wgObjectCaches;
if ( !isset( $wgObjectCaches[$id] ) ) {
@@
-146,7
+146,7
@@
class ObjectCache {
*
* @return string
*/
*
* @return string
*/
- p
ublic
static function getDefaultKeyspace() {
+ p
rivate
static function getDefaultKeyspace() {
global $wgCachePrefix;
$keyspace = $wgCachePrefix;
global $wgCachePrefix;
$keyspace = $wgCachePrefix;
@@
-178,7
+178,8
@@
class ObjectCache {
} elseif ( isset( $params['class'] ) ) {
$class = $params['class'];
// Automatically set the 'async' update handler
} elseif ( isset( $params['class'] ) ) {
$class = $params['class'];
// Automatically set the 'async' update handler
- $params['asyncHandler'] = $params['asyncHandler'] ?? 'DeferredUpdates::addCallableUpdate';
+ $params['asyncHandler'] = $params['asyncHandler']
+ ?? [ DeferredUpdates::class, 'addCallableUpdate' ];
// Enable reportDupes by default
$params['reportDupes'] = $params['reportDupes'] ?? true;
// Do b/c logic for SqlBagOStuff
// Enable reportDupes by default
$params['reportDupes'] = $params['reportDupes'] ?? true;
// Do b/c logic for SqlBagOStuff
@@
-296,7
+297,7
@@
class ObjectCache {
* @return WANObjectCache
* @throws UnexpectedValueException
*/
* @return WANObjectCache
* @throws UnexpectedValueException
*/
- p
ublic
static function newWANCacheFromId( $id ) {
+ p
rivate
static function newWANCacheFromId( $id ) {
global $wgWANObjectCaches, $wgObjectCaches;
if ( !isset( $wgWANObjectCaches[$id] ) ) {
global $wgWANObjectCaches, $wgObjectCaches;
if ( !isset( $wgWANObjectCaches[$id] ) ) {
@@
-392,12
+393,19
@@
class ObjectCache {
*/
public static function detectLocalServerCache() {
if ( function_exists( 'apcu_fetch' ) ) {
*/
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' ) ) {
} 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';
}
} elseif ( function_exists( 'wincache_ucache_get' ) ) {
return 'wincache';
}
+
return CACHE_NONE;
}
}
return CACHE_NONE;
}
}