Skip to content

Commit 597b6f0

Browse files
committed
fix silenced opcache loadable error
1 parent e749632 commit 597b6f0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

run-tests.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,17 +881,21 @@ function write_information(): void
881881
// load list of enabled and loadable extensions
882882
save_text($info_file, <<<'PHP'
883883
<?php
884-
echo str_replace("Zend OPcache", "opcache", implode(",", get_loaded_extensions()));
885-
$ext_dir = ini_get("extension_dir");
884+
$exts = [];
885+
foreach (get_loaded_extensions() as $ext) {
886+
$exts[] = ['Zend OPcache' => 'opcache'][$ext] ?? $ext;
887+
}
888+
$ext_dir = ini_get('extension_dir);
886889
foreach (scandir($ext_dir) as $file) {
887890
if (!preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
888891
continue;
889892
}
890893
$ext = $matches[1];
891-
if (!extension_loaded($ext) && @dl($file)) {
892-
echo ",", $ext;
894+
if (!in_array($ext, $exts) && !extension_loaded($ext) && @dl($file)) {
895+
exts[] = $ext;
893896
}
894897
}
898+
echo implode(',', $exts);
895899
?>
896900
PHP);
897901
$exts_to_test = explode(',', `$php $pass_options $info_params $no_file_cache "$info_file"`);

0 commit comments

Comments
 (0)