Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: check the $removeAll var before removing cache files. PATCH v…

…ia ajshort (#5672)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@107095 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 66ae6d0c8226ad9fd34da8242cd23fd87c0ad412 1 parent fec5057
Will Rossiter authored sminnee committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 tasks/RebuildStaticCacheTask.php
View
4 tasks/RebuildStaticCacheTask.php
@@ -35,7 +35,9 @@ function index() {
/**
* 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 @@ function rebuildCache($urls, $removeAll = true) {
$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) {
Please sign in to comment.
Something went wrong with that request. Please try again.