Skip to content

Commit c207269

Browse files
committed
Add php extension OS support checks to PackageInstaller
1 parent 097af80 commit c207269

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/StaticPHP/Package/PackageInstaller.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,14 @@ private function printArrayInfo(array $info): void
755755
private function validatePackagesBeforeBuild(): void
756756
{
757757
foreach ($this->packages as $package) {
758+
// Check OS support for php-extension packages
759+
if ($package instanceof PhpExtensionPackage && !$package->isSupportedOnCurrentOS()) {
760+
$supported = implode(', ', $package->getSupportedOSList());
761+
throw new WrongUsageException(
762+
"Extension '{$package->getName()}' is not supported on current OS: " . SystemTarget::getTargetOS() .
763+
". Supported OS: [{$supported}]"
764+
);
765+
}
758766
if ($package->getType() !== 'library') {
759767
continue;
760768
}

0 commit comments

Comments
 (0)