From 819d449c80692105ecaadcd433a038000b58700d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:41:38 +0000 Subject: [PATCH] ENHANCEMENT: throw user error when not passing correctly formatted array rather than simply passing (from r107088) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112583 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tasks/RebuildStaticCacheTask.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tasks/RebuildStaticCacheTask.php b/tasks/RebuildStaticCacheTask.php index 6d1df6eb..3b5dba7b 100644 --- a/tasks/RebuildStaticCacheTask.php +++ b/tasks/RebuildStaticCacheTask.php @@ -38,11 +38,16 @@ class RebuildStaticCacheTask extends Controller { * @param array $urls The URLs of pages to re-fetch and cache. */ function rebuildCache($urls, $removeAll = true) { - if(!is_array($urls)) return; // $urls must be an array + + if(!is_array($urls)) { + // $urls must be an array + user_error("Rebuild cache must be passed an array of urls. Make sure your allPagesToCache function returns an array", E_USER_ERROR); + return; + }; if(!Director::is_cli()) echo "
\n";
 		echo "Rebuilding cache.\nNOTE: Please ensure that this page ends with 'Done!' - if not, then something may have gone wrong.\n\n";
-		
+
 		$page = singleton('Page');
 		$cacheBaseDir = $page->getDestDir();