ENHANCEMENT Added user_error() if RebuildStaticCacheTask is called without a Page->allPagesToCache() method defined

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63198 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-09-28 22:41:02 +00:00
parent a322fbd59f
commit 740e3b724f

View File

@ -13,6 +13,14 @@ class RebuildStaticCacheTask extends Controller {
StaticPublisher::set_echo_progress(true); StaticPublisher::set_echo_progress(true);
$page = singleton('Page'); $page = singleton('Page');
if(!$page->hasMethod('allPagesToCache')) {
user_error(
'RebuildStaticCacheTask::index(): Please define a method "allPagesToCache()" on your Page class to return all pages affected by a cache refresh.',
E_USER_ERROR
);
}
if($_GET['urls']) $urls = $_GET['urls']; if($_GET['urls']) $urls = $_GET['urls'];
else $urls = $page->allPagesToCache(); else $urls = $page->allPagesToCache();