From 1787658d1572edd3b0cdef0bd8c307e7b37384ea Mon Sep 17 00:00:00 2001 From: Chris Buckley Date: Tue, 3 May 2011 18:04:07 +0100 Subject: fix for rest of dl() calls, also avoid ini_set() as may not work on safe_mode --- Tests/Auth/OpenID/StoreTest.php | 2 +- examples/detect.php | 2 +- examples/server/setup.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php index 4ff9f22..0847619 100644 --- a/Tests/Auth/OpenID/StoreTest.php +++ b/Tests/Auth/OpenID/StoreTest.php @@ -657,7 +657,7 @@ class Tests_Auth_OpenID_Included_StoreTest extends Tests_Auth_OpenID_Store { // The MDB2 test can use any database engine. MySQL is chosen // arbitrarily. if (!(extension_loaded('mysql') || - @dl('mysql.' . PHP_SHLIB_SUFFIX)) || + (function_exists('dl') && @dl('mysql.' . PHP_SHLIB_SUFFIX))) || !(@include_once 'MDB2.php')) { print "(not testing MDB2 store)"; $this->pass(); diff --git a/examples/detect.php b/examples/detect.php index 123e496..f745739 100644 --- a/examples/detect.php +++ b/examples/detect.php @@ -314,7 +314,7 @@ function detect_stores($r, &$out) $found = array(); foreach (array('sqlite', 'mysql', 'pgsql') as $dbext) { - if (extension_loaded($dbext) || (ini_get('enable_dl') && dl($dbext . '.' . PHP_SHLIB_SUFFIX))) { + if (extension_loaded($dbext) || (function_exists('dl') && @dl($dbext . '.' . PHP_SHLIB_SUFFIX))) { $found[] = $dbext; } } diff --git a/examples/server/setup.php b/examples/server/setup.php index e25ef34..0a42bff 100644 --- a/examples/server/setup.php +++ b/examples/server/setup.php @@ -176,19 +176,19 @@ function render_form() { $sqlite_found = false; if (extension_loaded('sqlite') || - @dl('sqlite.' . PHP_SHLIB_SUFFIX)) { + (function_exists('dl') && @dl('sqlite.' . PHP_SHLIB_SUFFIX))) { $sqlite_found = true; } $mysql_found = false; if (extension_loaded('mysql') || - @dl('mysql.' . PHP_SHLIB_SUFFIX)) { + (function_exists('dl') && @dl('mysql.' . PHP_SHLIB_SUFFIX))) { $mysql_found = true; } $pgsql_found = false; if (extension_loaded('pgsql') || - @dl('pgsql.' . PHP_SHLIB_SUFFIX)) { + (function_exists('dl') && @dl('pgsql.' . PHP_SHLIB_SUFFIX))) { $pgsql_found = true; } -- cgit v1.1