summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-05-18 13:38:53 +0200
committerAnatol Belski <ab@php.net>2018-05-18 13:38:53 +0200
commitee0ca6470dfcd97d84d7d4d24aface665f0022aa (patch)
treefe38748af97d96f0dfd76a67c15e9096098eef92
parent2d9836a57971085ff35e4588afc016c55b61825c (diff)
downloadphp-git-ee0ca6470dfcd97d84d7d4d24aface665f0022aa.tar.gz
Fix cli server test fails after recent AppVeyor image update
-rw-r--r--sapi/cli/tests/php_cli_server.inc18
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}";