diff options
Diffstat (limited to 'modules/openid/openid.install')
-rw-r--r-- | modules/openid/openid.install | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/openid/openid.install b/modules/openid/openid.install index 5a90568de..2859e2619 100644 --- a/modules/openid/openid.install +++ b/modules/openid/openid.install @@ -92,20 +92,27 @@ function openid_requirements($phase) { if ($phase == 'runtime') { // Check for the PHP BC Math library. - if (!function_exists('bcadd')) { - $requirements['bcmath'] = array( + if (!function_exists('bcadd') && !function_exists('gmp_add')) { + $requirements['openid_math'] = array( 'value' => t('Not installed'), 'severity' => REQUIREMENT_ERROR, - 'description' => t('OpenID requires the BC Math library for PHP which is missing or outdated. Check the <a href="@url">PHP BC Math Library documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/en/book.bc.php')), + 'description' => t('OpenID suggest the use of either the the <a href="@gmp">GMP Math</a> (recommended for performance) or <a href="@bc">BC Math</a> libraries to enable OpenID associations.', array('@gmp' => 'http://php.net/manual/en/book.gmp.php', '@bc' => 'http://www.php.net/manual/en/book.bc.php')), + ); + } + elseif (!function_exists('gmp_add')) { + $requirements['openid_math'] = array( + 'value' => t('Not optimized'), + 'severity' => REQUIREMENT_WARNING, + 'description' => t('OpenID suggests the use of the GMP Math library for PHP for optimal performance. Check the <a href="@url">GMP Math Library documentation</a> for installation instructions.', array('@url' => 'http://www.php.net/manual/en/book.gmp.php')), ); } else { - $requirements['bcmath'] = array( + $requirements['openid_math'] = array( 'value' => t('Installed'), 'severity' => REQUIREMENT_OK, ); } - $requirements['bcmath']['title'] = t('BC Math library'); + $requirements['openid_math']['title'] = t('OpenID Math library'); } return $requirements; |