From 7be3fc7475405860f48703089f743a6da2e007b0 Mon Sep 17 00:00:00 2001 From: Anton Farygin Date: Wed, 22 Jul 2020 14:26:04 +0300 Subject: [PATCH] start php-openssl server with the same arguments for php as the parent process. this commit enable tests for php-openssl with /proc/self/cmdline available --- ext/openssl/tests/ServerClientTestCase.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/openssl/tests/ServerClientTestCase.inc b/ext/openssl/tests/ServerClientTestCase.inc index 753366df6f..2fb2cf4476 100644 --- a/ext/openssl/tests/ServerClientTestCase.inc +++ b/ext/openssl/tests/ServerClientTestCase.inc @@ -71,9 +71,13 @@ class ServerClientTestCase WORKER_ARGV_VALUE ); } else { + # get arguments for the current php process and remove the script name. + # use this data to start the server process + $current_args=preg_replace('/-f.*$/','',str_replace("\0"," ",file_get_contents("/proc/self/cmdline"))); + $ini = php_ini_loaded_file(); $cmd = sprintf( '%s "%s" %s %s', - PHP_BINARY, + $current_args, __FILE__, WORKER_ARGV_VALUE, $worker @@ -115,7 +119,6 @@ class ServerClientTestCase $code .= $line; } - eval($code); } -- 2.25.4