aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2009-06-13 13:14:27 +0000
committerChris Smith <toonarmy@phpbb.com>2009-06-13 13:14:27 +0000
commit75ae7aee971c91e8548aabc93319dfa0789d6164 (patch)
treee584d84784b96a7fa32c00d3cdcaae1bf97f82f4 /phpBB/includes/acm
parent290893c3a7b97d3cc0e150705906c59b7e6d4185 (diff)
downloadforums-75ae7aee971c91e8548aabc93319dfa0789d6164.tar
forums-75ae7aee971c91e8548aabc93319dfa0789d6164.tar.gz
forums-75ae7aee971c91e8548aabc93319dfa0789d6164.tar.bz2
forums-75ae7aee971c91e8548aabc93319dfa0789d6164.tar.xz
forums-75ae7aee971c91e8548aabc93319dfa0789d6164.zip
Fix some issues with XCache, can't totally resolve the purge() method as XCache does not expose its settings to userland PHP. #46435
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9579 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acm')
-rw-r--r--phpBB/includes/acm/acm_memory.php2
-rw-r--r--phpBB/includes/acm/acm_xcache.php24
2 files changed, 22 insertions, 4 deletions
diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php
index fd9b9ff342..1ed4fb0d55 100644
--- a/phpBB/includes/acm/acm_memory.php
+++ b/phpBB/includes/acm/acm_memory.php
@@ -39,7 +39,7 @@ class acm_memory
global $phpbb_root_path, $dbname, $table_prefix;
$this->cache_dir = $phpbb_root_path . 'cache/';
- $this->key_prefix = md5($dbname, $table_prefix) . '_';
+ $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_';
if (!isset($this->extension) || !extension_loaded($this->extension))
{
diff --git a/phpBB/includes/acm/acm_xcache.php b/phpBB/includes/acm/acm_xcache.php
index ad527b8220..d0a614660c 100644
--- a/phpBB/includes/acm/acm_xcache.php
+++ b/phpBB/includes/acm/acm_xcache.php
@@ -25,10 +25,25 @@ if (!class_exists('acm_memory'))
/**
* ACM for XCache
* @package acm
+*
+* To use this module you need ini_get() enabled and the following INI settings configured as follows:
+* - xcache.var_size > 0
+* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
+*
*/
class acm extends acm_memory
{
- var $extension = 'xcache';
+ var $extension = 'XCache';
+
+ function acm()
+ {
+ parent::acm_memory();
+
+ if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0)
+ {
+ trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR);
+ }
+ }
/**
* Purge cache data
@@ -37,14 +52,17 @@ class acm extends acm_memory
*/
function purge()
{
+ // Run before for XCache, if admin functions are disabled it will terminate execution
+ parent::purge();
+
+ // If the admin authentication is enabled but not set up, this will cause a nasty error.
+ // Not much we can do about it though.
$n = xcache_count(XC_TYPE_VAR);
for ($i = 0; $i < $n; $i++)
{
xcache_clear_cache(XC_TYPE_VAR, $i);
}
-
- parent::purge();
}
/**