Commit 778a97b3 authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #1827 from neoascetic/flush_file_cache

Ability to flush file-based cache storage
parents 92e3ae47 0d99d132
...@@ -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