function delete($filename = null) { if ($filename !== null) $this->filename = $filename; $file_path = $this->path.$this->filename; if (file_exists($file_path.'.cache')) unlink($file_path.'.cache'); elseif (is_dir($file_path)) unlink($file_path); // Reset values $this->reset(); }