|
|
|
@ -39,17 +39,26 @@ class MappedLocal extends \OC\Files\Storage\Common{
|
|
|
|
|
new \RecursiveDirectoryIterator($this->buildPath($path)),
|
|
|
|
|
\RecursiveIteratorIterator::CHILD_FIRST
|
|
|
|
|
);
|
|
|
|
|
foreach ($it as $file) {
|
|
|
|
|
/**
|
|
|
|
|
* RecursiveDirectoryIterator on an NFS path isn't iterable with foreach
|
|
|
|
|
* This bug is fixed in PHP 5.5.9 or before
|
|
|
|
|
* See #8376
|
|
|
|
|
*/
|
|
|
|
|
$it->rewind();
|
|
|
|
|
while ($it->valid()) {
|
|
|
|
|
/**
|
|
|
|
|
* @var \SplFileInfo $file
|
|
|
|
|
*/
|
|
|
|
|
$file = $it->current();
|
|
|
|
|
if (in_array($file->getBasename(), array('.', '..'))) {
|
|
|
|
|
$it->next();
|
|
|
|
|
continue;
|
|
|
|
|
} elseif ($file->isDir()) {
|
|
|
|
|
rmdir($file->getPathname());
|
|
|
|
|
} elseif ($file->isFile() || $file->isLink()) {
|
|
|
|
|
unlink($file->getPathname());
|
|
|
|
|
}
|
|
|
|
|
$it->next();
|
|
|
|
|
}
|
|
|
|
|
if ($result = @rmdir($this->buildPath($path))) {
|
|
|
|
|
$this->cleanMapper($path);
|
|
|
|
|