Skip to content

Commit 81c6153

Browse files
committed
add --with-frankenphp-app option to embed an app
1 parent ab8c3e4 commit 81c6153

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use SPC\toolchain\GccNativeToolchain;
1717
use SPC\toolchain\ToolchainManager;
1818
use SPC\util\DependencyUtil;
19+
use SPC\util\GlobalEnvManager;
1920
use SPC\util\SPCConfigUtil;
2021
use SPC\util\SPCTarget;
2122

@@ -134,8 +135,8 @@ protected function sanityCheck(int $build_target): void
134135
if (($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
135136
logger()->info('running embed sanity check');
136137
$sample_file_path = SOURCE_PATH . '/embed-test';
137-
if (!is_dir($sample_file_path) && !mkdir($sample_file_path) && !is_dir($sample_file_path)) {
138-
throw new SPCInternalException("Failed to create directory: {$sample_file_path}");
138+
if (!is_dir($sample_file_path)) {
139+
@mkdir($sample_file_path);
139140
}
140141
// copy embed test files
141142
copy(ROOT_DIR . '/src/globals/common-tests/embed.c', $sample_file_path . '/embed.c');
@@ -267,8 +268,6 @@ protected function patchPhpScripts(): void
267268
/**
268269
* Process the --with-frankenphp-app option
269270
* Creates app.tar and app.checksum in source/frankenphp directory
270-
*
271-
* @return bool True if the app.tar was created successfully, false otherwise
272271
*/
273272
protected function processFrankenphpApp(): void
274273
{
@@ -313,11 +312,11 @@ protected function getFrankenPHPVersion(): string
313312

314313
protected function buildFrankenphp(): void
315314
{
315+
GlobalEnvManager::addPathIfNotExists(GoXcaddy::getEnvironment()['PATH']);
316316
$this->processFrankenphpApp();
317317
$nobrotli = $this->getLib('brotli') === null ? ',nobrotli' : '';
318318
$nowatcher = $this->getLib('watcher') === null ? ',nowatcher' : '';
319319
$xcaddyModules = getenv('SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES');
320-
// Check if we have a custom app.tar in source/frankenphp
321320
$frankenphpSourceDir = SOURCE_PATH . '/frankenphp';
322321

323322
$xcaddyModules = preg_replace('#--with github.com/dunglas/frankenphp(=\S+)?#', '', $xcaddyModules);

0 commit comments

Comments
 (0)