Commit 0d99d132 authored by Pavel Puchkin's avatar Pavel Puchkin

Ability to flush file-based cache storage

parent 92e3ae47
...@@ -97,4 +97,14 @@ class File extends Driver { ...@@ -97,4 +97,14 @@ class File extends Driver {
if (file_exists($this->path.$key)) @unlink($this->path.$key); if (file_exists($this->path.$key)) @unlink($this->path.$key);
} }
} /**
\ No newline at end of file * Flush the entire cache.
*
* @return void
*/
public function flush()
{
array_map('unlink', glob($this->path.'*'));
}
}
...@@ -87,15 +87,15 @@ class Redis extends Driver { ...@@ -87,15 +87,15 @@ class Redis extends Driver {
{ {
$this->redis->del($key); $this->redis->del($key);
} }
/** /**
* Flush the entire cache. * Flush the entire cache.
* *
* @return void * @return void
*/ */
public function flush() public function flush()
{ {
$this->redis->flushdb(); $this->redis->flushdb();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment