mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-20 06:08:08 +01:00
merge from yiisoft/yii2
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +524,7 @@ class BaseFileHelper
|
||||
return $list;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* @param string $dir
|
||||
*/
|
||||
private static function setBasePath($dir, $options)
|
||||
@@ -534,7 +538,7 @@ class BaseFileHelper
|
||||
return $options;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* @param string $dir
|
||||
*/
|
||||
private static function openDir($dir)
|
||||
@@ -546,7 +550,7 @@ class BaseFileHelper
|
||||
return $handle;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* @param string $dir
|
||||
*/
|
||||
private static function clearDir($dir)
|
||||
|
||||
Reference in New Issue
Block a user