From 597db25178f1022a6c98d6282706a7fd5796c199 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Thu, 19 Jun 2025 10:00:56 +0700 Subject: [PATCH] frankenphp requires ZTS --- src/SPC/command/BuildPHPCommand.php | 7 +++++++ src/SPC/store/LockFile.php | 1 + 2 files changed, 8 insertions(+) diff --git a/src/SPC/command/BuildPHPCommand.php b/src/SPC/command/BuildPHPCommand.php index 29cedf8f..92852e41 100644 --- a/src/SPC/command/BuildPHPCommand.php +++ b/src/SPC/command/BuildPHPCommand.php @@ -319,6 +319,13 @@ class BuildPHPCommand extends BuildCommand $rule |= BUILD_TARGET_EMBED; f_putenv('SPC_CMD_VAR_PHP_EMBED_TYPE=' . ($embed === 'static' ? 'static' : 'shared')); } + if ($this->getOption('build-frankenphp')) { + $rule |= BUILD_TARGET_FRANKENPHP; + if (!$this->getOption('enable-zts')) { + logger()->warning('FrankenPHP requires ZTS to work with multiple threads, the --enable-zts option will be enabled automatically!'); + $this->input->setOption('enable-zts', true); + } + } $rule |= ($this->getOption('build-frankenphp') ? (BUILD_TARGET_FRANKENPHP | BUILD_TARGET_EMBED) : BUILD_TARGET_NONE); $rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE); return $rule; diff --git a/src/SPC/store/LockFile.php b/src/SPC/store/LockFile.php index 044b2472..132d3764 100644 --- a/src/SPC/store/LockFile.php +++ b/src/SPC/store/LockFile.php @@ -78,6 +78,7 @@ class LockFile } // Write the updated lock data back to the file + FileSystem::createDir(dirname(self::LOCK_FILE)); file_put_contents(self::LOCK_FILE, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); }