function($real = true)
{
if (is_file($this->cfg['cache_file'])) {
$last_modified = time();
$this->file_mtime = filemtime($this->cfg['cache_file']);
$c =& $this->cfg;
// Only checks if the file exists and is valid
if (
!$real
&& \is_array($c['content'])
&& (($last_modified - $this->file_mtime) < $this->cache_length)
) {
return true;
}
clearstatcache();
// Real research for last mods and generation timestamps
if ($c['is_component']) {
foreach ($c['content'] as $name => $cp) {
foreach ($cp as $type => $files) {
foreach ($files as $f) {
if (is_file($this->fpath . $f)) {
$last_modified = filemtime($this->fpath . $f);
if ($last_modified > $this->file_mtime) {
return false;
}
}
else {
throw new \Exception("Impossible to find the file $f!");
}
}
}
}
}
else {
foreach ($this->cfg['content'][$this->mode] as $f) {
if (is_file($this->fpath . $f)) {
$last_modified = filemtime($this->fpath . $f);
if ($last_modified > $this->file_mtime) {
return false;
}
}
else {
//adump($this->cfg);
throw new \Exception("Impossible to find the file $f!");
}
}
}
return true;
}
return false;
}