Add static extension filter

This commit is contained in:
crazywhalecc 2025-04-18 12:18:20 +08:00
parent 8b07b15f6c
commit 61eafa48ff
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -130,6 +130,10 @@ class BuildPHPCommand extends BuildCommand
$display_libs = array_filter($libraries, fn ($lib) => in_array(Config::getLib($lib, 'type', 'lib'), ['lib', 'package']));
$display_extensions = array_map(fn ($ext) => in_array($ext, $shared_extensions) ? "*{$ext}" : $ext, $extensions);
// separate static and shared extensions from $extensions
// filter rule: including shared extensions if they are in $static_extensions or $shared_extensions
$static_extensions = array_filter($extensions, fn ($ext) => !in_array($ext, $shared_extensions) || in_array($ext, $static_extensions));
// print info
$indent_texts = [
'Build OS' => PHP_OS_FAMILY . ' (' . php_uname('m') . ')',