Skip to content

Commit

Permalink
Issue.1714 json session tests (#1717)
Browse files Browse the repository at this point in the history
* Add json.so as well if we don't find it.

See #1714

* Remove added newline
  • Loading branch information
michael-grunder committed Mar 2, 2020
1 parent bf27e6e commit 0ce7ca2
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions tests/RedisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6423,21 +6423,26 @@ private function getPhpCommand($script)
$cmd .= $test_args;
} else {
/* Only append specific extension directives if PHP hasn't been compiled with what we need statically */
$result = shell_exec("$cmd --no-php-ini -m");
$redis = strpos($result, 'redis') !== false;
$igbinary = strpos($result, 'igbinary') !== false;
$msgpack = strpos($result, 'msgpack') !== false;
$modules = shell_exec("$cmd --no-php-ini -m");

if (!$redis || !$igbinary || !$msgpack) {
$cmd .= ' --no-php-ini';
if (!$msgpack) {
$cmd .= ' --define extension=msgpack.so';
}
if (!$igbinary) {
$cmd .= ' --define extension=igbinary.so';
/* Determine if we need to specifically add extensions */
$arr_extensions = array_filter(
['redis', 'igbinary', 'msgpack', 'json'],
function ($module) use ($modules) {
return strpos($modules, $module) === false;
}
if (!$redis) {
$cmd .= ' --define extension=' . dirname(__DIR__) . '/modules/redis.so';
);

/* If any are needed add them to the command */
if ($arr_extensions) {
$cmd .= ' --no-php-ini';
foreach ($arr_extensions as $str_extension) {
/* We want to use the locally built redis extension */
if ($str_extension == 'redis') {
$str_extension = dirname(__DIR__) . '/modules/redis';
}

$cmd .= " --define extension=$str_extension.so";
}
}
}
Expand Down

0 comments on commit 0ce7ca2

Please sign in to comment.