aports/community/php82/fix-fpm-deps.patch
2022-12-08 13:57:40 +00:00

66 lines
2.4 KiB
Diff

Patch-Source: https://github.com/php/php-src/pull/9854
From db2d32f476b09a640616ad111999cb33e3fc9cf3 Mon Sep 17 00:00:00 2001
From: Jakub Zelenka <bukka@php.net>
Date: Sun, 30 Oct 2022 16:36:58 +0000
Subject: [PATCH] Introduce TEST_FPM_EXTENSION_DIR for FPM tests with shared
extensions
---
sapi/fpm/tests/bug77780-header-sent-error.phpt | 2 +-
sapi/fpm/tests/tester.inc | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/sapi/fpm/tests/bug77780-header-sent-error.phpt b/sapi/fpm/tests/bug77780-header-sent-error.phpt
index b5e76918547f..017a2aa513c2 100644
--- a/sapi/fpm/tests/bug77780-header-sent-error.phpt
+++ b/sapi/fpm/tests/bug77780-header-sent-error.phpt
@@ -24,7 +24,7 @@ echo str_repeat('asdfghjkl', 150000) . "\n";
EOT;
$tester = new FPM\Tester($cfg, $code);
-$tester->start();
+$tester->start(extensions: ['session']);
$tester->expectLogStartNotices();
$tester
->request(
diff --git a/sapi/fpm/tests/tester.inc b/sapi/fpm/tests/tester.inc
index 2c4b81bd5903..6197cdba53f5 100644
--- a/sapi/fpm/tests/tester.inc
+++ b/sapi/fpm/tests/tester.inc
@@ -379,12 +379,17 @@ class Tester
* @param array $extraArgs Command extra arguments.
* @param bool $forceStderr Whether to output to stderr so error log is used.
* @param bool $daemonize Whether to start FPM daemonized
+ * @param array $extensions List of extension to add if shared build used.
*
* @return bool
* @throws \Exception
*/
- public function start(array $extraArgs = [], bool $forceStderr = true, bool $daemonize = false)
- {
+ public function start(
+ array $extraArgs = [],
+ bool $forceStderr = true,
+ bool $daemonize = false,
+ array $extensions = []
+ ) {
$configFile = $this->createConfig();
$desc = $this->outDesc ? [] : [1 => array('pipe', 'w'), 2 => array('redirect', 1)];
@@ -399,6 +404,14 @@ class Tester
$cmd[] = '-F';
}
+ $extensionDir = getenv('TEST_FPM_EXTENSION_DIR');
+ if ($extensionDir) {
+ $cmd[] = '-dextension_dir=' . $extensionDir;
+ foreach ($extensions as $extension) {
+ $cmd[] = '-dextension=' . $extension;
+ }
+ }
+
if (getenv('TEST_FPM_RUN_AS_ROOT')) {
$cmd[] = '--allow-to-run-as-root';
}