mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
Add standalone list
This commit is contained in:
@@ -42,6 +42,14 @@ class GenExtTestMatrixCommand extends BaseCommand
|
|||||||
['swow', 'swoole'],
|
['swow', 'swoole'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extensions that must always appear alone in their own matrix entry.
|
||||||
|
* Use display names (without ext- prefix).
|
||||||
|
*/
|
||||||
|
private const array STANDALONE = [
|
||||||
|
'grpc',
|
||||||
|
];
|
||||||
|
|
||||||
protected bool $no_motd = true;
|
protected bool $no_motd = true;
|
||||||
|
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
@@ -124,14 +132,19 @@ class GenExtTestMatrixCommand extends BaseCommand
|
|||||||
$covered = [];
|
$covered = [];
|
||||||
$groups = [];
|
$groups = [];
|
||||||
$orphans = [];
|
$orphans = [];
|
||||||
|
$standalone_set = array_fill_keys(self::STANDALONE, true);
|
||||||
|
|
||||||
foreach (array_merge($roots, $non_roots) as $ext) {
|
foreach (array_merge($roots, $non_roots) as $ext) {
|
||||||
if (isset($covered[$ext])) {
|
if (isset($covered[$ext])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$chain = $this->dfsCollect($ext, $ext_deps, $pool_set, $covered);
|
$chain = $this->dfsCollect($ext, $ext_deps, $pool_set, $covered);
|
||||||
if (count($chain) === 1 && empty($ext_deps[$ext])) {
|
$display = $this->displayName($ext);
|
||||||
$orphans[] = $this->displayName($ext);
|
if (isset($standalone_set[$display])) {
|
||||||
|
// Always emit standalone extensions as their own single entry
|
||||||
|
$groups[] = $display;
|
||||||
|
} elseif (count($chain) === 1 && empty($ext_deps[$ext])) {
|
||||||
|
$orphans[] = $display;
|
||||||
} else {
|
} else {
|
||||||
$groups[] = implode(',', array_map($this->displayName(...), $chain));
|
$groups[] = implode(',', array_map($this->displayName(...), $chain));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user