From 73ce1a5a976f3f1634e9aeffa8fbe79378870c71 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 15 Nov 2012 01:56:33 +0100 Subject: [PATCH 1/2] [ticket/11199] Purge dumped container correctly on cache purge. This patch changes the dumped container suffix to a prefix instead which makes the existing code for purging 'cache/container_*' files work as intended. PHPBB3-11199 --- phpBB/includes/functions_container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 1763d1082a..9f84511439 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -133,5 +133,5 @@ function phpbb_create_dumped_container_unless_debug(array $extensions, array $pa function phpbb_container_filename($phpbb_root_path, $php_ext) { $filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path); - return $phpbb_root_path . 'cache/' . $filename . '_container.' . $php_ext; + return $phpbb_root_path . 'cache/container_' . $filename . '.' . $php_ext; } From a0cc2878a365e2f36728f3b102c131cd055f6874 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 15 Nov 2012 02:30:43 +0100 Subject: [PATCH 2/2] [ticket/11199] Match cache purge container files against container_* Previously it was matching against only container*, checking for the underscore is consistent with the other checks. PHPBB3-11199 --- phpBB/includes/cache/driver/file.php | 2 +- phpBB/includes/cache/driver/memory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/cache/driver/file.php b/phpBB/includes/cache/driver/file.php index b20c0064ea..32bdb1918a 100644 --- a/phpBB/includes/cache/driver/file.php +++ b/phpBB/includes/cache/driver/file.php @@ -214,7 +214,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base while (($entry = readdir($dir)) !== false) { - if (strpos($entry, 'container') !== 0 && + if (strpos($entry, 'container_') !== 0 && strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && diff --git a/phpBB/includes/cache/driver/memory.php b/phpBB/includes/cache/driver/memory.php index 98ac02b161..1ea9a3e9e7 100644 --- a/phpBB/includes/cache/driver/memory.php +++ b/phpBB/includes/cache/driver/memory.php @@ -162,7 +162,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base while (($entry = readdir($dir)) !== false) { - if (strpos($entry, 'container') !== 0 && + if (strpos($entry, 'container_') !== 0 && strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 &&