updated-packages
This commit is contained in:
24
vendor/symfony/process/ExecutableFinder.php
vendored
24
vendor/symfony/process/ExecutableFinder.php
vendored
@@ -19,7 +19,7 @@ namespace Symfony\Component\Process;
|
||||
*/
|
||||
class ExecutableFinder
|
||||
{
|
||||
private $suffixes = array('.exe', '.bat', '.cmd', '.com');
|
||||
private $suffixes = ['.exe', '.bat', '.cmd', '.com'];
|
||||
|
||||
/**
|
||||
* Replaces default suffixes of executable.
|
||||
@@ -42,17 +42,17 @@ class ExecutableFinder
|
||||
/**
|
||||
* Finds an executable by name.
|
||||
*
|
||||
* @param string $name The executable name (without the extension)
|
||||
* @param string $default The default to return if no executable is found
|
||||
* @param array $extraDirs Additional dirs to check into
|
||||
* @param string $name The executable name (without the extension)
|
||||
* @param string|null $default The default to return if no executable is found
|
||||
* @param array $extraDirs Additional dirs to check into
|
||||
*
|
||||
* @return string The executable path or default value
|
||||
* @return string|null The executable path or default value
|
||||
*/
|
||||
public function find($name, $default = null, array $extraDirs = array())
|
||||
public function find($name, $default = null, array $extraDirs = [])
|
||||
{
|
||||
if (ini_get('open_basedir')) {
|
||||
$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));
|
||||
$dirs = array();
|
||||
if (\ini_get('open_basedir')) {
|
||||
$searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs);
|
||||
$dirs = [];
|
||||
foreach ($searchPath as $path) {
|
||||
// Silencing against https://bugs.php.net/69240
|
||||
if (@is_dir($path)) {
|
||||
@@ -65,15 +65,15 @@ class ExecutableFinder
|
||||
}
|
||||
} else {
|
||||
$dirs = array_merge(
|
||||
explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),
|
||||
explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),
|
||||
$extraDirs
|
||||
);
|
||||
}
|
||||
|
||||
$suffixes = array('');
|
||||
$suffixes = [''];
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
$pathExt = getenv('PATHEXT');
|
||||
$suffixes = array_merge($pathExt ? explode(PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes);
|
||||
$suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes);
|
||||
}
|
||||
foreach ($suffixes as $suffix) {
|
||||
foreach ($dirs as $dir) {
|
||||
|
Reference in New Issue
Block a user