diff options
author | Evan Prodromou <evan@status.net> | 2010-08-03 16:05:03 -0700 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-08-03 16:05:03 -0700 |
commit | 9f0715a9935966f3ec483bccc476d5baf3324b3c (patch) | |
tree | 9874247927e5e24044c75a48a9c04e427b0ba477 /extlib/Auth/OpenID/BigMath.php | |
parent | 004e42e3e0606f0f9e5c8b6cd4512e5d870cd56e (diff) | |
parent | b17fc0ca5b90d2cdc957ebc4870fbd2791b9e1b9 (diff) |
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'extlib/Auth/OpenID/BigMath.php')
-rw-r--r-- | extlib/Auth/OpenID/BigMath.php | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/extlib/Auth/OpenID/BigMath.php b/extlib/Auth/OpenID/BigMath.php index 45104947d..7fca2dc43 100644 --- a/extlib/Auth/OpenID/BigMath.php +++ b/extlib/Auth/OpenID/BigMath.php @@ -351,8 +351,7 @@ function Auth_OpenID_math_extensions() 'class' => 'Auth_OpenID_GmpMathWrapper'); } - $result[] = array( - 'modules' => array('bcmath', 'php_bcmath'), + $result[] = array('modules' => array('bcmath', 'php_bcmath'), 'extension' => 'bcmath', 'class' => 'Auth_OpenID_BcMathWrapper'); @@ -366,27 +365,9 @@ function Auth_OpenID_detectMathLibrary($exts) { $loaded = false; + $hasDl = function_exists('dl'); foreach ($exts as $extension) { - // See if the extension specified is already loaded. - if ($extension['extension'] && - extension_loaded($extension['extension'])) { - $loaded = true; - } - - // Try to load dynamic modules. - if (!$loaded) { - foreach ($extension['modules'] as $module) { - if (@dl($module . "." . PHP_SHLIB_SUFFIX)) { - $loaded = true; - break; - } - } - } - - // If the load succeeded, supply an instance of - // Auth_OpenID_MathWrapper which wraps the specified - // module's functionality. - if ($loaded) { + if (extension_loaded($extension['extension'])) { return $extension; } } @@ -405,7 +386,7 @@ function Auth_OpenID_detectMathLibrary($exts) * instance of a wrapper for that extension module. If no extension * module is found, an instance of {@link Auth_OpenID_MathWrapper} is * returned, which wraps the native PHP integer implementation. The - * proper calling convention for this method is $lib =& + * proper calling convention for this method is $lib = * Auth_OpenID_getMathLib(). * * This function checks for the existence of specific long number @@ -416,7 +397,7 @@ function Auth_OpenID_detectMathLibrary($exts) * * @package OpenID */ -function &Auth_OpenID_getMathLib() +function Auth_OpenID_getMathLib() { // The instance of Auth_OpenID_MathWrapper that we choose to // supply will be stored here, so that subseqent calls to this @@ -468,4 +449,4 @@ function Auth_OpenID_noMathSupport() return defined('Auth_OpenID_NO_MATH_SUPPORT'); } -?> + |