mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Return default version for musl and musl-wrapper
This commit is contained in:
parent
4e5c0f0a48
commit
a940200164
@ -189,7 +189,7 @@ class SystemUtil
|
|||||||
public static function getLibcVersionIfExists(): ?string
|
public static function getLibcVersionIfExists(): ?string
|
||||||
{
|
{
|
||||||
if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'glibc') {
|
if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'glibc') {
|
||||||
$result = shell()->execWithResult('ldd --version');
|
$result = shell()->execWithResult('ldd --version', false);
|
||||||
if ($result[0] !== 0) {
|
if ($result[0] !== 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -202,11 +202,13 @@ class SystemUtil
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
// for musl, disabled temporarily as musl has better compatibility between different patch version?
|
||||||
if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'musl') {
|
if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'musl') {
|
||||||
if (self::isMuslDist()) {
|
if (self::isMuslDist()) {
|
||||||
$result = shell()->execWithResult('ldd 2>&1');
|
$result = shell()->execWithResult('ldd 2>&1', false);
|
||||||
} else {
|
} else {
|
||||||
$result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1');
|
$result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1', false);
|
||||||
}
|
}
|
||||||
// Match Version * line
|
// Match Version * line
|
||||||
// match ldd version: "Version 1.2.3" match 1.2.3
|
// match ldd version: "Version 1.2.3" match 1.2.3
|
||||||
@ -215,6 +217,7 @@ class SystemUtil
|
|||||||
return $matches[1];
|
return $matches[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class Config
|
|||||||
if (self::$pre_built === null) {
|
if (self::$pre_built === null) {
|
||||||
self::$pre_built = FileSystem::loadConfigArray('pre-built');
|
self::$pre_built = FileSystem::loadConfigArray('pre-built');
|
||||||
}
|
}
|
||||||
$supported_sys_based = ['match-pattern'];
|
$supported_sys_based = ['match-pattern', 'prefer-stable', 'repo'];
|
||||||
if (in_array($name, $supported_sys_based)) {
|
if (in_array($name, $supported_sys_based)) {
|
||||||
$m_key = match (PHP_OS_FAMILY) {
|
$m_key = match (PHP_OS_FAMILY) {
|
||||||
'Windows' => ['-windows', '-win', ''],
|
'Windows' => ['-windows', '-win', ''],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user