Microweber\Utils\Adapters\Cache\Storage\FileStorage::forget PHP Method

forget() public method

Remove an item from the cache.
public forget ( string $key )
$key string
    public function forget($key)
    {
        $key = $this->appendLocale($key);
        $file = $this->path($key);
        if ($this->files->exists($file)) {
            @$this->files->delete($file);
        } else {
            $folder = substr($file, 0, -6);
            if ($this->files->exists($folder)) {
                @$this->files->deleteDirectory($folder);
            }
        }
        $this->memory = array();
    }

Usage Example

Beispiel #1
0
 /**
  * Remove an item from the cache.
  *
  * @param  string $key
  *
  * @return void
  */
 public function forget($key)
 {
     return $this->adapter->forget($key);
 }