diff options
author | Anatol Belski <ab@php.net> | 2018-05-18 13:38:53 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-05-18 13:38:53 +0200 |
commit | ee0ca6470dfcd97d84d7d4d24aface665f0022aa (patch) | |
tree | fe38748af97d96f0dfd76a67c15e9096098eef92 | |
parent | 2d9836a57971085ff35e4588afc016c55b61825c (diff) | |
download | php-git-ee0ca6470dfcd97d84d7d4d24aface665f0022aa.tar.gz |
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}"; |