aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm
diff options
context:
space:
mode:
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();
}
/**