public function FileBase::validateCache in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/File/FileBaseOld.php \Drupal\forena\File\FileBase::validateCache()
Validate a single cache entry
Parameters
unknown $ext:
unknown $base_name:
1 call to FileBase::validateCache()
- FileBase::_validateAllCache in src/
File/ FileBase.php
File
- src/
File/ FileBase.php, line 204 - FileBase.inc File toolbox for manipulating files contained tn the report directory.
Class
Namespace
Drupal\forena\FileCode
public function validateCache($ext, $base_name) {
if (isset($this->cache[$ext])) {
if (isset($this->cache[$ext][$base_name])) {
$obj = $this->cache[$ext][$base_name];
if (file_exists($obj->file)) {
$mtime = filemtime($obj->file);
if ($obj->cache === NULL || $mtime != $obj->mtime) {
//Expensive cache building process.
$this
->buildCache($ext, $base_name, $obj);
$this->needSave = TRUE;
}
$this->cache[$ext][$base_name] = $obj;
}
else {
// Remove the file from the cache.
unset($this->cache[$ext][$base_name]);
$this->needScan = TRUE;
$this->needSave = TRUE;
}
}
}
}