Skip to content
Snippets Groups Projects
Commit e83b4149 authored by Robin Appelman's avatar Robin Appelman
Browse files

remove unneeded delTree

parent c99e2541
Branches
No related tags found
No related merge requests found
......@@ -164,7 +164,7 @@ if (\OC_Util::runningOnWindows()) {
}
public function unlink($path) {
return $this->delTree($path);
return unlink($this->datadir . $path);
}
public function rename($path1, $path2) {
......@@ -212,30 +212,6 @@ if (\OC_Util::runningOnWindows()) {
return $return;
}
/**
* @param string $dir
*/
private function delTree($dir) {
$dirRelative = $dir;
$dir = $this->datadir . $dir;
if (!file_exists($dir)) return true;
if (!is_dir($dir) || is_link($dir)) return unlink($dir);
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') continue;
if (is_file($dir . '/' . $item)) {
if (unlink($dir . '/' . $item)) {
}
} elseif (is_dir($dir . '/' . $item)) {
if (!$this->delTree($dirRelative . "/" . $item)) {
return false;
};
}
}
if ($return = rmdir($dir)) {
}
return $return;
}
/**
* @param string $fullPath
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment