mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
adjust doctor for os and linux musl check
This commit is contained in:
parent
90b2e5568c
commit
2768dc0c40
@ -26,7 +26,7 @@ class LinuxMuslCheck
|
||||
}
|
||||
|
||||
$musl_wrapper_lib = sprintf('/lib/ld-musl-%s.so.1', php_uname('m'));
|
||||
if (file_exists($musl_wrapper_lib)) {
|
||||
if (file_exists($musl_wrapper_lib) && file_exists('/usr/local/musl/bin/musl-gcc')) {
|
||||
return CheckResult::ok();
|
||||
}
|
||||
return CheckResult::fail('musl-wrapper is not installed on your system', 'fix-musl-wrapper');
|
||||
@ -71,7 +71,7 @@ class LinuxMuslCheck
|
||||
Downloader::downloadSource($musl_version_name, $musl_source);
|
||||
FileSystem::extractSource($musl_version_name, DOWNLOAD_PATH . "/{$musl_version_name}.tar.gz");
|
||||
logger()->info('Installing musl wrapper');
|
||||
shell(true)->cd(SOURCE_PATH . "/{$musl_version_name}")
|
||||
shell()->cd(SOURCE_PATH . "/{$musl_version_name}")
|
||||
->exec('./configure')
|
||||
->exec('make -j')
|
||||
->exec("{$prefix}make install");
|
||||
@ -106,7 +106,7 @@ class LinuxMuslCheck
|
||||
Downloader::downloadSource('musl-compile', $musl_compile_source);
|
||||
logger()->info('Extracting musl-cross');
|
||||
FileSystem::extractSource('musl-compile', DOWNLOAD_PATH . "/{$arch}-musl-toolchain.tgz");
|
||||
shell(true)->exec($prefix . 'cp -rf ' . SOURCE_PATH . '/musl-compile/* /usr/local/musl');
|
||||
shell()->exec($prefix . 'cp -rf ' . SOURCE_PATH . '/musl-compile/* /usr/local/musl');
|
||||
return true;
|
||||
} catch (RuntimeException) {
|
||||
return false;
|
||||
|
||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\doctor\item;
|
||||
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\builder\traits\UnixSystemUtilTrait;
|
||||
use SPC\doctor\AsCheckItem;
|
||||
use SPC\doctor\CheckResult;
|
||||
@ -18,6 +19,7 @@ class OSCheckList
|
||||
if (!in_array(PHP_OS_FAMILY, ['Darwin', 'Linux', 'BSD'])) {
|
||||
return CheckResult::fail('Current OS is not supported');
|
||||
}
|
||||
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . ', supported');
|
||||
$distro = PHP_OS_FAMILY === 'Linux' ? (' ' . SystemUtil::getOSRelease()['dist']) : '';
|
||||
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . $distro . ', supported');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user