mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
Suggestions
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\store;
|
||||
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\exception\DownloaderException;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
@@ -594,12 +593,8 @@ class Downloader
|
||||
{
|
||||
$os_family = PHP_OS_FAMILY;
|
||||
$gnu_arch = getenv('GNU_ARCH') ?: 'unknown';
|
||||
$libc = match (getenv('SPC_TARGET')) {
|
||||
SPCTarget::MUSL_STATIC, SPCTarget::MUSL => 'musl',
|
||||
SPCTarget::GLIBC => 'glibc',
|
||||
default => 'default',
|
||||
};
|
||||
$libc_version = SystemUtil::getLibcVersionIfExists() ?? 'default';
|
||||
$libc = SPCTarget::getLibc();
|
||||
$libc_version = SPCTarget::getLibcVersion() ?? 'default';
|
||||
|
||||
return "{$source}-{$os_family}-{$gnu_arch}-{$libc}-{$libc_version}";
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
class SourcePatcher
|
||||
{
|
||||
@@ -456,7 +457,7 @@ class SourcePatcher
|
||||
|
||||
public static function patchFfiCentos7FixO3strncmp(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY !== 'Linux' || SystemUtil::getLibcVersionIfExists() > '2.17') {
|
||||
if (!($ver = SPCTarget::getLibcVersion()) || version_compare($ver, '2.17', '>')) {
|
||||
return false;
|
||||
}
|
||||
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace SPC\store\pkg;
|
||||
use SPC\store\Downloader;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\LockFile;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
|
||||
class GoXcaddy extends CustomPackage
|
||||
{
|
||||
@@ -62,7 +61,6 @@ class GoXcaddy extends CustomPackage
|
||||
|
||||
FileSystem::extractPackage($name, $source_type, $filename, $extract);
|
||||
|
||||
GlobalEnvManager::init();
|
||||
// install xcaddy
|
||||
shell()
|
||||
->appendEnv([
|
||||
|
||||
Reference in New Issue
Block a user