check if a directory exists before we try to remove it
This commit is contained in:
parent
c2e83e635d
commit
64bfcbee0a
|
@ -159,7 +159,11 @@ class View {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rmdir($path) {
|
public function rmdir($path) {
|
||||||
|
if ($this->is_dir($path)) {
|
||||||
return $this->basicOperation('rmdir', $path, array('delete'));
|
return $this->basicOperation('rmdir', $path, array('delete'));
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function opendir($path) {
|
public function opendir($path) {
|
||||||
|
@ -712,7 +716,7 @@ class View {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$defaultRoot = Filesystem::getRoot();
|
$defaultRoot = Filesystem::getRoot();
|
||||||
if($this->fakeRoot === $defaultRoot){
|
if ($this->fakeRoot === $defaultRoot) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
|
return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
|
||||||
|
|
Loading…
Reference in New Issue