Skip to content

Commit 637eb05

Browse files
committed
fix silenced opcache loadable error
1 parent f4c766f commit 637eb05

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
@@ -880,17 +880,21 @@ function write_information(): void
880880
// load list of enabled and loadable extensions
881881
save_text($info_file, <<<'PHP'
882882
<?php
883-
echo str_replace("Zend OPcache", "opcache", implode(",", get_loaded_extensions()));
884-
$ext_dir = ini_get("extension_dir");
883+
$exts = [];
884+
foreach (get_loaded_extensions() as $ext) {
885+
$exts[] = ['Zend OPcache' => 'opcache'][$ext] ?? $ext;
886+
}
887+
$ext_dir = ini_get('extension_dir');
885888
foreach (scandir($ext_dir) as $file) {
886889
if (!preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
887890
continue;
888891
}
889892
$ext = $matches[1];
890-
if (!extension_loaded($ext) && @dl($file)) {
891-
echo ",", $ext;
893+
if (!in_array($ext, $exts) && !extension_loaded($ext) && @dl($file)) {
894+
$exts[] = $ext;
892895
}
893896
}
897+
echo implode(',', $exts);
894898
?>
895899
PHP);
896900
$exts_to_test = explode(',', shell_exec("$php $pass_options $info_params $no_file_cache \"$info_file\""));

0 commit comments

Comments
 (0)