From 9519ad3a6fc3ed596f136b9e22ee7d2ff1996dd1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:41:44 +0000 Subject: [PATCH] BUGFIX: check the $removeAll var before removing cache files. PATCH via ajshort (#5672) (from r107095) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112584 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tasks/RebuildStaticCacheTask.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/RebuildStaticCacheTask.php b/tasks/RebuildStaticCacheTask.php index 3b5dba7b..557363d0 100644 --- a/tasks/RebuildStaticCacheTask.php +++ b/tasks/RebuildStaticCacheTask.php @@ -35,7 +35,9 @@ class RebuildStaticCacheTask extends Controller { /** * Rebuilds the static cache for the pages passed through via $urls + * * @param array $urls The URLs of pages to re-fetch and cache. + * @param bool $removeAll Remove all stale cache files (default TRUE). */ function rebuildCache($urls, $removeAll = true) { @@ -82,7 +84,7 @@ class RebuildStaticCacheTask extends Controller { $urls = array_slice($urls, $start, $count); - if(!isset($_GET['urls']) && $start == 0 && file_exists("../cache")) { + if($removeAll && !isset($_GET['urls']) && $start == 0 && file_exists("../cache")) { echo "Removing stale cache files... \n"; flush(); if (FilesystemPublisher::$domain_based_caching) {