From 36fe2eab5648dabd32edb2256ae858b9aa09f229 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Oct 2010 04:19:38 +0000 Subject: [PATCH] ENHANCEMENT: create cache directory when it does not exist before running the cache build test (from r103708) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112174 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tasks/RebuildStaticCacheTask.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/RebuildStaticCacheTask.php b/tasks/RebuildStaticCacheTask.php index 11018544..486ac729 100644 --- a/tasks/RebuildStaticCacheTask.php +++ b/tasks/RebuildStaticCacheTask.php @@ -46,6 +46,10 @@ class RebuildStaticCacheTask extends Controller { $page = singleton('Page'); $cacheBaseDir = $page->getDestDir(); + if(!file_exists($cacheBaseDir)) { + mkdir($cacheBaseDir); + } + if (file_exists($cacheBaseDir.'/lock') && !isset($_REQUEST['force'])) die("There already appears to be a publishing queue running. You can skip warning this by adding ?/&force to the URL."); touch($cacheBaseDir.'/lock');