// This will destory an existing cache file!
if ($this->ret == $this->statusDone) {
// Mark it as no longer readable
- unset($this->readable[$this->name]);
- unset($GLOBALS['file_readable'][$this->fqfn]);
+ $this->markCacheAsUnreadable();
// Create file
if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
}
}
+ // Mark the cache as unreadable
+ function markCacheAsUnreadable () {
+ unset($this->readable[$this->name]);
+ unset($GLOBALS['file_readable'][$this->fqfn]);
+ }
+
function addRow ($data) {
// Is the pointe rvalid?
if (is_resource($this->pointer)) {
} else {
// Cache file not found or not readable
addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".sprintf(getMessage('CACHE_CANNOT_LOAD'), $this->fqfn));
+
+ // Try to remove it
+ $this->removeCacheFile();
}
}
// Destroy an existing cache file
function removeCacheFile ($removeArray = false, $force = false) {
+ // Remove cached value of readable cache
+ $this->markCacheAsUnreadable();
+
// Debug message
/* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("%s should be removed.", $this->name));
// Remove cache file from system
removeFile($this->fqfn);
- // No longer readable!
- unset($this->readable[$this->name]);
-
// Shall we remove the array from memory?
if ($removeArray === true) {
// Debug message if allowed