public function delete($files)
{
$files = (array) $files;
foreach ($files as $file) {
$file = $this->getPathInfo($file, 'pathname');
if (is_dir($file)) {
if (substr($file, -1) != '/') {
$file .= '/';
}
foreach ($this->listDir($file) as $name) {
if (!$this->delete($file . $name)) {
return false;
}
}
if (!@rmdir($file)) {
return false;
}
} elseif (!@unlink($file)) {
return false;
}
}
return true;
}