@@ -878,13 +878,7 @@ function write_information(): void
878
878
// load list of enabled and loadable extensions
879
879
save_text ($ info_file , <<<'PHP'
880
880
<?php
881
- $exts = [];
882
- foreach (get_loaded_extensions() as $ext) {
883
- if ($ext === 'Core') {
884
- continue;
885
- }
886
- $exts[] = ['Zend OPcache' => 'opcache'][$ext] ?? $ext;
887
- }
881
+ $exts = remap_loaded_extensions_names(get_loaded_extensions());
888
882
$ext_dir = ini_get('extension_dir');
889
883
foreach (scandir($ext_dir) as $file) {
890
884
if (!preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
@@ -2785,6 +2779,19 @@ function run_test(string $php, $file, array $env): string
2785
2779
return $ restype [0 ] . 'ED ' ;
2786
2780
}
2787
2781
2782
+ function remap_loaded_extensions_names (array $ names ): array
2783
+ {
2784
+ $ exts = [];
2785
+ foreach ($ names as $ name ) {
2786
+ if ($ name === 'Core ' ) {
2787
+ continue ;
2788
+ }
2789
+ $ exts [] = strtolower (['Zend OPcache ' => 'opcache ' ][$ name ] ?? $ name );
2790
+ }
2791
+
2792
+ return $ exts ;
2793
+ }
2794
+
2788
2795
/**
2789
2796
* @return bool|int
2790
2797
*/
@@ -3672,13 +3679,8 @@ public function getExtensions(string $php): array
3672
3679
}
3673
3680
3674
3681
$ extDir = shell_exec ("$ php -d display_errors=0 -r \"echo ini_get('extension_dir'); \"" );
3675
- $ extensionsRaw = explode (", " , shell_exec ("$ php -d display_errors=0 -r \"echo implode(',', get_loaded_extensions()); \"" ));
3676
- foreach ($ extensionsRaw as $ ext ) {
3677
- if ($ ext === 'Core ' ) {
3678
- continue ;
3679
- }
3680
- $ extensions [] = strtolower (['Zend OPcache ' => 'opcache ' ][$ ext ] ?? $ ext );
3681
- }
3682
+ $ extensions = explode (", " , shell_exec ("$ php -d display_errors=0 -r \"echo implode(',', get_loaded_extensions()); \"" ));
3683
+ $ extensions = remap_loaded_extensions_names ($ extensions );
3682
3684
3683
3685
$ result = [$ extDir , $ extensions ];
3684
3686
$ this ->extensions [$ php ] = $ result ;
0 commit comments