Determine the available math library GMP vs. BCMath, favouring GMP for performance.

8 calls to _openid_get_math_library()
openid_begin in modules/openid/openid.module
The initial step of OpenID authentication responsible for the following:
_openid_math_add in modules/openid/openid.inc
Calls the add function from the available math library for OpenID.
_openid_math_cmp in modules/openid/openid.inc
Calls the cmp function from the available math library for OpenID.
_openid_math_div in modules/openid/openid.inc
Calls the div function from the available math library for OpenID.
_openid_math_mod in modules/openid/openid.inc
Calls the mod function from the available math library for OpenID.

... See full list

File

modules/openid/openid.inc, line 720
OpenID utility functions.

Code

function _openid_get_math_library() {

  // Not drupal_static(), because a function is not going to disappear and
  // change the output of this under any circumstances.
  static $library;
  if (empty($library)) {
    if (function_exists('gmp_add')) {
      $library = 'gmp';
    }
    elseif (function_exists('bcadd')) {
      $library = 'bcmath';
    }
  }
  return $library;
}