Upgrade to 3.9.4
This commit is contained in:
@@ -521,12 +521,26 @@ class F
|
||||
Dir::make($directory, true);
|
||||
}
|
||||
|
||||
// actually move the file
|
||||
if (rename($oldRoot, $newRoot) !== true) {
|
||||
return false;
|
||||
// atomically moving the file will only work if
|
||||
// source and target are on the same filesystem
|
||||
if (stat($oldRoot)['dev'] === stat($directory)['dev']) {
|
||||
// same filesystem, we can move the file
|
||||
return rename($oldRoot, $newRoot) === true;
|
||||
}
|
||||
|
||||
return true;
|
||||
// @codeCoverageIgnoreStart
|
||||
// not the same filesystem; we need to copy
|
||||
// the file and unlink the source afterwards
|
||||
if (copy($oldRoot, $newRoot) === true) {
|
||||
return unlink($oldRoot) === true;
|
||||
}
|
||||
|
||||
// copying failed, ensure the new root isn't there
|
||||
// (e.g. if the file could be created but there's no
|
||||
// more remaining disk space to write its contents)
|
||||
static::remove($newRoot);
|
||||
return false;
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user