updated backend
This commit is contained in:
parent
1fea0f4fe7
commit
11521c2339
3459 changed files with 72735 additions and 168535 deletions
|
|
@ -35,16 +35,26 @@ class PhpExecutableFinder
|
|||
*/
|
||||
public function find($includeArgs = true)
|
||||
{
|
||||
if ($php = getenv('PHP_BINARY')) {
|
||||
if (!is_executable($php)) {
|
||||
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
|
||||
if ($php = strtok(exec($command.' '.escapeshellarg($php)), PHP_EOL)) {
|
||||
if (!is_executable($php)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $php;
|
||||
}
|
||||
|
||||
$args = $this->findArguments();
|
||||
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
|
||||
|
||||
// HHVM support
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
|
||||
}
|
||||
|
||||
// PHP_BINARY return the current sapi executable
|
||||
if (PHP_BINARY && \in_array(\PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) {
|
||||
if (PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) {
|
||||
return PHP_BINARY.$args;
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +76,7 @@ class PhpExecutableFinder
|
|||
return $php;
|
||||
}
|
||||
|
||||
$dirs = array(PHP_BINDIR);
|
||||
$dirs = [PHP_BINDIR];
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
$dirs[] = 'C:\xampp\php\\';
|
||||
}
|
||||
|
|
@ -81,11 +91,8 @@ class PhpExecutableFinder
|
|||
*/
|
||||
public function findArguments()
|
||||
{
|
||||
$arguments = array();
|
||||
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
$arguments[] = '--php';
|
||||
} elseif ('phpdbg' === \PHP_SAPI) {
|
||||
$arguments = [];
|
||||
if ('phpdbg' === \PHP_SAPI) {
|
||||
$arguments[] = '-qrr';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue