Merge branch 'PHP-8.0' into PHP-8.1

This commit is contained in:
Jakub Zelenka 2022-11-13 19:06:10 +00:00
commit b8c1b5e9fa
2 changed files with 16 additions and 3 deletions

View file

@ -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(

View file

@ -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';
}