Ejemplo n.º 1
0
 /**
  * Deletes a cache item by id or tag
  *
  * @param   string   cache id
  * @return  boolean
  */
 public function delete($key)
 {
     $files = $this->exists($key);
     if (empty($files)) {
         return FALSE;
     }
     // Disable all error reporting while deleting
     $ER = error_reporting(0);
     foreach ($files as $file) {
         // Remove the cache file
         if (!unlink($file)) {
             Ko::log('error', 'Cache: Unable to delete cache file: ' . $file);
         }
     }
     // Turn on error reporting again
     error_reporting($ER);
     return TRUE;
 }