Ability to flush file-based cache storage

This commit is contained in:
Pavel Puchkin 2013-03-29 11:02:26 +11:00
parent 92e3ae47bb
commit 0d99d13298
2 changed files with 17 additions and 7 deletions

View File

@ -97,4 +97,14 @@ public function forget($key)
if (file_exists($this->path.$key)) @unlink($this->path.$key);
}
}
/**
* Flush the entire cache.
*
* @return void
*/
public function flush()
{
array_map('unlink', glob($this->path.'*'));
}
}

View File

@ -87,15 +87,15 @@ public function forget($key)
{
$this->redis->del($key);
}
/**
* Flush the entire cache.
*
*
* @return void
*/
public function flush()
{
$this->redis->flushdb();
}
public function flush()
{
$this->redis->flushdb();
}
}