Cache_Lite::remove PHP Method

remove() public method

Remove a cache file
public remove ( string $id, string $group = 'default' ) : boolean
$id string cache id
$group string name of the cache group
return boolean true if no problem
    function remove($id, $group = 'default')
    {
        $this->_setFileName($id, $group);
        if ($this->_memoryCaching) {
            if (isset($this->_memoryCachingArray[$this->_file])) {
                unset($this->_memoryCachingArray[$this->_file]);
                $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1;
            }
            if ($this->_onlyMemoryCaching) {
                return true;
            }
        }
        return $this->_unlink($this->_file);
    }

Usage Example

Example #1
0
 /**
  * This is a warpper for Cache_Lite::remove(), since it generates
  * strict warnings.
  * 
  * @param mixed $key The key to remove from cache
  * 
  * @return result of Cache_Lite::remove(), without the strict warnings
  */
 protected function removeFromCache($key)
 {
     $current = error_reporting();
     error_reporting($current & ~E_STRICT);
     $this->cache->remove($key);
     error_reporting($current);
 }
All Usage Examples Of Cache_Lite::remove