mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix cli server test fails after recent AppVeyor image update
This commit is contained in:
commit
a8422edced
1 changed files with 12 additions and 6 deletions
|
@ -11,13 +11,13 @@ function php_cli_server_start($code = 'echo "Hello world";', $router = 'index.ph
|
||||||
file_put_contents($doc_root . '/' . ($router ?: 'index.php'), '<?php ' . $code . ' ?>');
|
file_put_contents($doc_root . '/' . ($router ?: 'index.php'), '<?php ' . $code . ' ?>');
|
||||||
}
|
}
|
||||||
|
|
||||||
$descriptorspec = array(
|
|
||||||
0 => STDIN,
|
|
||||||
1 => STDOUT,
|
|
||||||
2 => STDERR,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||||
|
$descriptorspec = array(
|
||||||
|
0 => STDIN,
|
||||||
|
1 => STDOUT,
|
||||||
|
2 => array("pipe", "w"),
|
||||||
|
);
|
||||||
|
|
||||||
$cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
$cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
||||||
if (!is_null($router)) {
|
if (!is_null($router)) {
|
||||||
$cmd .= " {$router}";
|
$cmd .= " {$router}";
|
||||||
|
@ -25,6 +25,12 @@ function php_cli_server_start($code = 'echo "Hello world";', $router = 'index.ph
|
||||||
|
|
||||||
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
||||||
} else {
|
} else {
|
||||||
|
$descriptorspec = array(
|
||||||
|
0 => STDIN,
|
||||||
|
1 => STDOUT,
|
||||||
|
2 => STDERR,
|
||||||
|
);
|
||||||
|
|
||||||
$cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
$cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS;
|
||||||
if (!is_null($router)) {
|
if (!is_null($router)) {
|
||||||
$cmd .= " {$router}";
|
$cmd .= " {$router}";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue