function Runtime::getRawBinary
Returns the raw path to the binary of the current runtime.
1 call to Runtime::getRawBinary()
- Runtime::getBinary in vendor/
sebastian/ environment/ src/ Runtime.php - Returns the escaped path to the binary of the current runtime.
File
-
vendor/
sebastian/ environment/ src/ Runtime.php, line 96
Class
Namespace
SebastianBergmann\EnvironmentCode
public function getRawBinary() : string {
if (self::$initialized) {
return self::$rawBinary;
}
if (PHP_BINARY !== '') {
self::$rawBinary = PHP_BINARY;
self::$initialized = true;
return self::$rawBinary;
}
// @codeCoverageIgnoreStart
$possibleBinaryLocations = [
PHP_BINDIR . '/php',
PHP_BINDIR . '/php-cli.exe',
PHP_BINDIR . '/php.exe',
];
foreach ($possibleBinaryLocations as $binary) {
if (is_readable($binary)) {
self::$rawBinary = $binary;
self::$initialized = true;
return self::$rawBinary;
}
}
self::$rawBinary = 'php';
self::$initialized = true;
return self::$rawBinary;
// @codeCoverageIgnoreEnd
}