mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
fix cs
This commit is contained in:
parent
e44efb2a54
commit
f4b2b9ae7d
@ -143,13 +143,11 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
||||||
if (PHP_OS_FAMILY === 'Darwin') {
|
if (PHP_OS_FAMILY === 'Darwin') {
|
||||||
$ext_path = 'DYLD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$DYLD_LIBRARY_PATH ';
|
$ext_path = 'DYLD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$DYLD_LIBRARY_PATH ';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$ext_path = 'LD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$LD_LIBRARY_PATH ';
|
$ext_path = 'LD_LIBRARY_PATH=' . BUILD_LIB_PATH . ':$LD_LIBRARY_PATH ';
|
||||||
}
|
}
|
||||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '/libphp.a');
|
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '/libphp.a');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$ext_path = '';
|
$ext_path = '';
|
||||||
$suffix = PHP_OS_FAMILY === 'Darwin' ? 'dylib' : 'so';
|
$suffix = PHP_OS_FAMILY === 'Darwin' ? 'dylib' : 'so';
|
||||||
foreach (glob(BUILD_LIB_PATH . "/libphp*.{$suffix}") as $file) {
|
foreach (glob(BUILD_LIB_PATH . "/libphp*.{$suffix}") as $file) {
|
||||||
@ -276,8 +274,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
$dynamic_exports = '';
|
$dynamic_exports = '';
|
||||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'shared') {
|
||||||
$libphpVersion = preg_replace('/\.\d+$/', '', $libphpVersion);
|
$libphpVersion = preg_replace('/\.\d+$/', '', $libphpVersion);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($dynamicSymbolsArgument = LinuxSystemUtil::getDynamicExportedSymbols(BUILD_LIB_PATH . '/libphp.a')) {
|
if ($dynamicSymbolsArgument = LinuxSystemUtil::getDynamicExportedSymbols(BUILD_LIB_PATH . '/libphp.a')) {
|
||||||
$dynamic_exports = ' ' . $dynamicSymbolsArgument;
|
$dynamic_exports = ' ' . $dynamicSymbolsArgument;
|
||||||
}
|
}
|
||||||
@ -317,8 +314,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
foreach (GoXcaddy::getEnvironment() as $key => $value) {
|
foreach (GoXcaddy::getEnvironment() as $key => $value) {
|
||||||
if ($key === 'PATH') {
|
if ($key === 'PATH') {
|
||||||
GlobalEnvManager::addPathIfNotExists($value);
|
GlobalEnvManager::addPathIfNotExists($value);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$env[$key] = $value;
|
$env[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,8 +325,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
if (!$this->getOption('no-strip', false) && file_exists(BUILD_BIN_PATH . '/frankenphp')) {
|
if (!$this->getOption('no-strip', false) && file_exists(BUILD_BIN_PATH . '/frankenphp')) {
|
||||||
if (PHP_OS_FAMILY === 'Linux') {
|
if (PHP_OS_FAMILY === 'Linux') {
|
||||||
shell()->cd(BUILD_BIN_PATH)->exec('strip --strip-unneeded frankenphp');
|
shell()->cd(BUILD_BIN_PATH)->exec('strip --strip-unneeded frankenphp');
|
||||||
}
|
} else { // macOS doesn't understand strip-unneeded
|
||||||
else { // macOS doesn't understand strip-unneeded
|
|
||||||
shell()->cd(BUILD_BIN_PATH)->exec('strip -S frankenphp');
|
shell()->cd(BUILD_BIN_PATH)->exec('strip -S frankenphp');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user