Skip to content

Commit 597db25

Browse files
committed
frankenphp requires ZTS
1 parent c2d6b9a commit 597db25

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/SPC/command/BuildPHPCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ private function parseRules(array $shared_extensions = []): int
319319
$rule |= BUILD_TARGET_EMBED;
320320
f_putenv('SPC_CMD_VAR_PHP_EMBED_TYPE=' . ($embed === 'static' ? 'static' : 'shared'));
321321
}
322+
if ($this->getOption('build-frankenphp')) {
323+
$rule |= BUILD_TARGET_FRANKENPHP;
324+
if (!$this->getOption('enable-zts')) {
325+
logger()->warning('FrankenPHP requires ZTS to work with multiple threads, the --enable-zts option will be enabled automatically!');
326+
$this->input->setOption('enable-zts', true);
327+
}
328+
}
322329
$rule |= ($this->getOption('build-frankenphp') ? (BUILD_TARGET_FRANKENPHP | BUILD_TARGET_EMBED) : BUILD_TARGET_NONE);
323330
$rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE);
324331
return $rule;

src/SPC/store/LockFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static function put(string $lock_name, ?array $lock_content): void
7878
}
7979

8080
// Write the updated lock data back to the file
81+
FileSystem::createDir(dirname(self::LOCK_FILE));
8182
file_put_contents(self::LOCK_FILE, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
8283
}
8384

0 commit comments

Comments
 (0)