public function clear() { $path = $this->options['temp']; if ($dir = opendir($path)) { while ($file = readdir($dir)) { $check = is_dir($file); if (!$check) { unlink($path . $file); } } closedir($dir); return true; } }