merge from yiisoft/yii2

This commit is contained in:
cuileon
2018-11-14 11:57:32 +08:00
parent 47df8a8cc0
commit 489dd119a5
426 changed files with 18465 additions and 4215 deletions

View File

@@ -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)