Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1575,15 +1575,19 @@ function run_test($php, $file, $env)

// Additional required extensions
if (array_key_exists('EXTENSIONS', $section_text)) {
$ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
$ext_params = array();
settings2array($ini_overwrites, $ext_params);
settings2params($ext_params);
$ext_dir=`$php $pass_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`;
$extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS']));
$loaded = explode(",", `$php -n -r 'echo implode(",", get_loaded_extensions());'`);
$loaded = explode(",", `$php $pass_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`);
$ext_prefix = substr(PHP_OS, 0, 3) === "WIN" ? "php_" : "";
foreach ($extensions as $req_ext) {
if (!in_array($req_ext, $loaded)) {
if ($req_ext == 'opcache') {
$ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
$ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
} else {
$ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
$ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions tests/run-test/bug75042-2.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
phpt EXTENSIONS directive with static module
--SKIPIF--
<?php
if(empty($_ENV['TEST_PHP_EXECUTABLE'])) {
die('skip TEST_PHP_EXECUTABLE not set');
}
$php = $_ENV['TEST_PHP_EXECUTABLE'];
if (false === stripos(`$php -n -m`, 'spl')) {
die('skip spl is NOT built static');
}
--EXTENSIONS--
SPL
--FILE--
<?php
var_dump(extension_loaded('spl'));
--EXPECT--
bool(true)
8 changes: 8 additions & 0 deletions tests/run-test/bug75042-3.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--TEST--
phpt EXTENSIONS directive with nonexistent shared module
--EXTENSIONS--
nonexistentsharedmodule
--FILE--
<?php
--EXPECTF--
PHP Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A
20 changes: 20 additions & 0 deletions tests/run-test/bug75042.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
phpt EXTENSIONS directive with shared module
--SKIPIF--
<?php
if(empty($_ENV['TEST_PHP_EXECUTABLE'])) {
die('skip TEST_PHP_EXECUTABLE not set');
}
$php = $_ENV['TEST_PHP_EXECUTABLE'];
if (false !== stripos(`$php -n -m`, 'openssl')) {
die('skip openssl is built static');
}
$ext_module = ini_get('extension_dir') . DIRECTORY_SEPARATOR . (substr(PHP_OS, 0, 3) === "WIN" ? "php_openssl." : "openssl.") . PHP_SHLIB_SUFFIX;
if( !file_exists($ext_module) ) die('skip openssl shared extension not found');
--EXTENSIONS--
openssl
--FILE--
<?php
var_dump(extension_loaded('openssl'));
--EXPECT--
bool(true)