Yes! It is writeable.
But I have added this line. ( if(is_array($cache_files)) { )
It seems that the function glob() can't return the value (array) to the $cache_files.
It works for me to add the line : if(is_array($cache_files)) {
Thank you!
public function __construct() {
$this->registry = Registry::getInstance ();
$cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);
if(is_array($cache_files)) {
foreach ($cache_files as $file) {
//first of all check if file expired. delete it if needed
$file_time = filemtime($file);
if ( (time() - $file_time) > $this->expire ) {
if (file_exists($file)) {
unlink($file);
continue;
}
}
//build cache map as array {cache_file_name_without_timestamp=>expire_time}
$ch_base = substr($file,0,-11);
$this->cache_map[$ch_base] = $file_time + $this->expire;
}
}
}