mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
Add php extension OS support checks to PackageInstaller
This commit is contained in:
@@ -755,6 +755,14 @@ class PackageInstaller
|
|||||||
private function validatePackagesBeforeBuild(): void
|
private function validatePackagesBeforeBuild(): void
|
||||||
{
|
{
|
||||||
foreach ($this->packages as $package) {
|
foreach ($this->packages as $package) {
|
||||||
|
// Check OS support for php-extension packages
|
||||||
|
if ($package instanceof PhpExtensionPackage && !$package->isSupportedOnCurrentOS()) {
|
||||||
|
$supported = implode(', ', $package->getSupportedOSList());
|
||||||
|
throw new WrongUsageException(
|
||||||
|
"Extension '{$package->getName()}' is not supported on current OS: " . SystemTarget::getTargetOS() .
|
||||||
|
". Supported OS: [{$supported}]"
|
||||||
|
);
|
||||||
|
}
|
||||||
if ($package->getType() !== 'library') {
|
if ($package->getType() !== 'library') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user