mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 00:35:41 +08:00
Add PackageInfoCommand to display package configuration information and support status
This commit is contained in:
@@ -138,6 +138,16 @@ abstract class Package
|
||||
return $this->stages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of OS families that have a registered build function (via #[BuildFor]).
|
||||
*
|
||||
* @return string[] e.g. ['Linux', 'Darwin']
|
||||
*/
|
||||
public function getBuildForOSList(): array
|
||||
{
|
||||
return array_keys($this->build_functions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the package has a specific stage defined.
|
||||
*
|
||||
|
||||
@@ -280,6 +280,27 @@ class PhpExtensionPackage extends Package
|
||||
$builder->deployBinary($soFile, $soFile, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get per-OS build support status for this php-extension.
|
||||
*
|
||||
* Rules (same as v2):
|
||||
* - OS not listed in 'support' config => 'yes' (fully supported)
|
||||
* - OS listed with 'wip' => 'wip'
|
||||
* - OS listed with 'partial' => 'partial'
|
||||
* - OS listed with 'no' => 'no'
|
||||
*
|
||||
* @return array<string, string> e.g. ['Linux' => 'yes', 'Darwin' => 'partial', 'Windows' => 'no']
|
||||
*/
|
||||
public function getBuildSupportStatus(): array
|
||||
{
|
||||
$exceptions = $this->extension_config['support'] ?? [];
|
||||
$result = [];
|
||||
foreach (['Linux', 'Darwin', 'Windows'] as $os) {
|
||||
$result[$os] = $exceptions[$os] ?? 'yes';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register default stages if not already defined by attributes.
|
||||
* This is called after all attributes have been loaded.
|
||||
|
||||
Reference in New Issue
Block a user