public function cleanup()
{
// Don't cleanup a custom path, who knows what other stuff is there
if (Path::get_path() === $this->get_custom_path()) {
return;
}
foreach (new CleanUpIterator(new \DirectoryIterator(Path::get_path())) as $file) {
if ($file->isDot() || !$file->isReadable() || !$file->isFile()) {
continue;
}
@unlink($file->getPathname());
}
}