mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
ENHANCEMENT: throw user error when not passing correctly formatted array rather than simply passing
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@107088 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5c84e5b0f1
commit
fec50572e9
@ -38,11 +38,16 @@ class RebuildStaticCacheTask extends Controller {
|
|||||||
* @param array $urls The URLs of pages to re-fetch and cache.
|
* @param array $urls The URLs of pages to re-fetch and cache.
|
||||||
*/
|
*/
|
||||||
function rebuildCache($urls, $removeAll = true) {
|
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 "<pre>\n";
|
if(!Director::is_cli()) echo "<pre>\n";
|
||||||
echo "Rebuilding cache.\nNOTE: Please ensure that this page ends with 'Done!' - if not, then something may have gone wrong.\n\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');
|
$page = singleton('Page');
|
||||||
$cacheBaseDir = $page->getDestDir();
|
$cacheBaseDir = $page->getDestDir();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user