diff options
author | Anatol Belski <ab@php.net> | 2018-05-18 13:40:42 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-05-18 13:40:42 +0200 |
commit | a8422edced04550b970476a070ed2e5406f0edb9 (patch) | |
tree | cf3e03950d8800442bc359afbd11e8508d24dcc8 | |
parent | c8ab9e1e53533b44cd4c377426ec5681727f5802 (diff) | |
parent | ee0ca6470dfcd97d84d7d4d24aface665f0022aa (diff) | |
download | php-git-a8422edced04550b970476a070ed2e5406f0edb9.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Fix cli server test fails after recent AppVeyor image update
-rw-r--r-- | sapi/cli/tests/php_cli_server.inc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 5ee3887957..2a21ba35d0 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -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 . ' ?>'); } - $descriptorspec = array( - 0 => STDIN, - 1 => STDOUT, - 2 => STDERR, - ); - 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; if (!is_null($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)); } else { + $descriptorspec = array( + 0 => STDIN, + 1 => STDOUT, + 2 => STDERR, + ); + $cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; if (!is_null($router)) { $cmd .= " {$router}"; |