From 53ab456ebf4bf4fd352dceab61122e3e9c5742b8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 31 Jul 2011 01:52:38 +0000 Subject: [PATCH] * (bug 30131) XCache with variable caching disabled no longer used for variable caching (CACHE_ACCEL) Patch from John Du Hart: https://bugzilla.wikimedia.org/attachment.cgi?id=8849&action=diff If XCache is present, but the xcache.var_size setting is off, we'll now consider it as xcache being disabled for CACHE_ACCEL purposes. It won't trigger view of the accelerator option in the installer, and at runtime if using CACHE_ACCEL and no other modules are available, it'll throw an error so you know that it doesn't work! --- RELEASE-NOTES-1.18 | 1 + includes/installer/Installer.php | 3 +++ includes/objectcache/ObjectCache.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.18 b/RELEASE-NOTES-1.18 index fa535c7409..f7dfabaac0 100644 --- a/RELEASE-NOTES-1.18 +++ b/RELEASE-NOTES-1.18 @@ -432,6 +432,7 @@ production. * (bug 27427) mw.util.getParamValue shouldn't return value from hash even if param is only present in hash. * Installer checked for magic_quotes_runtime instead of register_globals. +* (bug 30131) XCache with variable caching disabled no longer used for variable caching (CACHE_ACCEL) === API changes in 1.18 === * BREAKING CHANGE: action=watch now requires POST and token. diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 0b37f4a65b..4467428330 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -791,6 +791,9 @@ abstract class Installer { $caches = array(); foreach ( $this->objectCaches as $name => $function ) { if ( function_exists( $function ) ) { + if ( $name == 'xcache' && !wfIniGetBool( 'xcache.var_size' ) ) { + continue; + } $caches[$name] = true; } } diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 25d4d470dd..99e3895378 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -93,7 +93,7 @@ class ObjectCache { $id = 'eaccelerator'; } elseif ( function_exists( 'apc_fetch') ) { $id = 'apc'; - } elseif( function_exists( 'xcache_get' ) ) { + } elseif( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) { $id = 'xcache'; } elseif( function_exists( 'wincache_ucache_get' ) ) { $id = 'wincache'; -- 2.20.1