handle rmdir on files for ftp storages

This commit is contained in:
Robin Appelman 2015-07-16 15:44:10 +02:00
parent 15877ac7eb
commit db89d1cec8

View file

@ -40,8 +40,11 @@ abstract class StreamWrapper extends Common {
}
public function rmdir($path) {
if ($this->file_exists($path) && $this->isDeletable($path)) {
if ($this->is_dir($path) && $this->isDeletable($path)) {
$dh = $this->opendir($path);
if (!is_resource($dh)) {
return false;
}
while (($file = readdir($dh)) !== false) {
if ($this->is_dir($path . '/' . $file)) {
$this->rmdir($path . '/' . $file);