Merge pull request #9616 from clxmstaab/fast-first
Filesystem: use fast operation first in emptyDirectory()pull/9618/head
commit
c800db04d3
|
@ -63,7 +63,7 @@ class Filesystem
|
|||
|
||||
public function emptyDirectory($dir, $ensureDirectoryExists = true)
|
||||
{
|
||||
if (file_exists($dir) && is_link($dir)) {
|
||||
if (is_link($dir) && file_exists($dir)) {
|
||||
$this->unlink($dir);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Filesystem
|
|||
return unlink($directory);
|
||||
}
|
||||
|
||||
if (!file_exists($directory) || !is_dir($directory)) {
|
||||
if (!is_dir($directory) || !file_exists($directory)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue