mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 11:39:41 +08:00
Fixes #16183: Fixed when yii\helpers\BaseFileHelper sometimes returned wrong value
This commit is contained in:
committed by
Alexander Makarov
parent
f8f53a2d07
commit
ba0a3c00ca
@ -415,9 +415,13 @@ class BaseFileHelper
|
||||
return unlink($path);
|
||||
} catch (ErrorException $e) {
|
||||
// last resort measure for Windows
|
||||
$lines = [];
|
||||
exec('DEL /F/Q ' . escapeshellarg($path), $lines, $deleteError);
|
||||
return $deleteError !== 0;
|
||||
if (function_exists('exec') && file_exists($path)) {
|
||||
exec('DEL /F/Q ' . escapeshellarg($path));
|
||||
|
||||
return !file_exists($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user