21301 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 352 Views |
-
Error in RebuildStaticCacheTask.php ?!

12 July 2011 at 1:59am Last edited: 12 July 2011 3:54am
In an older Version I found:
if($removeAll && file_exists("../cache")) {
echo "Removing old cache... \n";
flush();
Filesystem::removeFolder("../cache", true);
echo "done.\n\n";
}in 2.4.5 Line 87 it says:
if($removeAll && !isset($_GET['urls']) && $start == 0 && file_exists("../cache")) {
echo "Removing stale cache files... \n";
flush();
if (FilesystemPublisher::$domain_based_caching) {
// Glob each dir, then glob each one of those
foreach(glob(BASE_PATH . '/cache/*', GLOB_ONLYDIR) as $cacheDir) {
foreach(glob($cacheDir.'/*') as $cacheFile) {
$searchCacheFile = trim(str_replace($cacheBaseDir, '', $cacheFile), '\/');
if (!in_array($searchCacheFile, $mappedUrls)) {
echo " * Deleting $cacheFile\n";
@unlink($cacheFile);
}
}
}
} else {
}
echo "done.\n\n";
}Why is the else code empty?
FilesystemPublisher::$domain_based_caching is false for default. Shouldn't there be somethink like this:Filesystem::removeFolder("../cache", true);
Offtopic: Where to report bugs? I think 'General Questions' is not the correkt place?
Edit: I set:
FilesystemPublisher::$domain_based_caching = true;
In my config.php and changed Link() to AbsoluteLink() in Page->subPagesToCache():function subPagesToCache($translate='all') {
$urls = array();
// add current page
if($this->nocache!=1){
$urls[] = $this->AbsoluteLink();
// add translations
if($translate=='all'){
$translations = Translatable::getTranslations();
if(is_object($translations)){
foreach($translations as $translation){
$urls[] = $translation->AbsoluteLink();
}
}
}
// cache the RSS feed if comments are enabled
if ($this->ProvideComments) {
$urls[] = Director::absoluteBaseURL() . "pagecomment/rss/" . $this->ID;
}
}
return $urls;It doesn't deleting anything when I make a dev/buildcache
-
Re: Error in RebuildStaticCacheTask.php ?!

12 July 2011 at 6:42pm
Offtopic: Where to report bugs? I think 'General Questions' is not the correkt place?
Bugs should go to open.silverstripe.org. If you have patches or code which you want to submit to the core it can either go to that open.silverstripe.org site or our new location on github.com/silverstripe/sapphire as a pull request.
-
Re: Error in RebuildStaticCacheTask.php ?!

13 July 2011 at 1:44am
Thanks Willr I've made a new Ticket: http://open.silverstripe.org/ticket/6679
| 352 Views | ||
|
Page:
1
|
Go to Top |


