public function flush($all = false)
{
$this->memory = array();
if (empty($this->tags) or $all == true) {
if (is_dir($this->directory)) {
$this->rmdir($this->directory);
}
} else {
foreach ($this->tags as $tag) {
if (in_array($tag, $this->deleted_tags)) {
// break;
}
$items = $this->forgetTags($tag);
$del = $this->directory . '/' . $tag;
$del = $this->normalize_path($del);
$this->rmdir($del);
}
}
}