1
0
Fork 0

Clear stat cache after calling filesystem commands

pull/1718/merge
Jordi Boggiano 2013-03-21 15:21:54 +01:00
parent d929a0813a
commit 61efd2998c
1 changed files with 13 additions and 3 deletions

View File

@ -159,7 +159,12 @@ class Filesystem
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
// Try to copy & delete - this is a workaround for random "Access denied" errors.
$command = sprintf('xcopy %s %s /E /I /Q', escapeshellarg($source), escapeshellarg($target));
if (0 === $this->processExecutor->execute($command, $output)) {
$result = $this->processExecutor->execute($command, $output);
// clear stat cache because external processes aren't tracked by the php stat cache
clearstatcache();
if (0 === $result) {
$this->remove($source);
return;
@ -170,7 +175,12 @@ class Filesystem
// We do not use PHP's "rename" function here since it does not support
// the case where $source, and $target are located on different partitions.
$command = sprintf('mv %s %s', escapeshellarg($source), escapeshellarg($target));
if (0 === $this->processExecutor->execute($command)) {
$result = $this->processExecutor->execute($command, $output);
// clear stat cache because external processes aren't tracked by the php stat cache
clearstatcache();
if (0 === $result) {
return;
}
}