From 7720c13ed242e87ce1e934f80378a6f145ebd769 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 9 Jul 2020 07:50:18 +0200 Subject: [PATCH 1/2] improve CGI usage --- tests/ext/startup_logging.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/ext/startup_logging.inc b/tests/ext/startup_logging.inc index 17235e11e..869e65da5 100644 --- a/tests/ext/startup_logging.inc +++ b/tests/ext/startup_logging.inc @@ -2,8 +2,12 @@ function dd_get_php_cgi() { - $executable = dirname(getenv('TEST_PHP_EXECUTABLE')) . '/php-cgi'; - return file_exists($executable) && is_executable($executable) ? $executable : ''; + $executable = getenv('TEST_PHP_CGI_EXECUTABLE') ?: getenv('TEST_PHP_EXECUTABLE') . '-cgi'; + if (file_exists($executable) && is_executable($executable)) { + $args = getenv('TEST_PHP_ARGS'); + return $args ? "$executable $args" : "$executable"; + } + return ''; } function dd_get_startup_logs(array $args = [], array $env = [])