ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
BigMath.php File Reference

Go to the source code of this file.

Data Structures

class  Auth_OpenID_MathLibrary
class  Auth_OpenID_BcMathWrapper
class  Auth_OpenID_GmpMathWrapper

Namespaces

namespace  OpenID
 This module contains code for dealing with associations between consumers and servers.

Functions

 Auth_OpenID_math_extensions ()
 Define the supported extensions.
 Auth_OpenID_detectMathLibrary ($exts)
 Detect which (if any) math library is available.
 Auth_OpenID_getMathLib ()
 Auth_OpenID_setNoMathSupport ()
 Auth_OpenID_noMathSupport ()

Function Documentation

Auth_OpenID_detectMathLibrary (   $exts)

Detect which (if any) math library is available.

Definition at line 364 of file BigMath.php.

Referenced by Auth_OpenID_getMathLib().

{
$loaded = false;
$hasDl = function_exists('dl');
foreach ($exts as $extension) {
if (extension_loaded($extension['extension'])) {
return $extension;
}
}
return false;
}

+ Here is the caller graph for this function:

Auth_OpenID_getMathLib ( )

Definition at line 400 of file BigMath.php.

References $result, Auth_OpenID_detectMathLibrary(), Auth_OpenID_math_extensions(), Auth_OpenID_noMathSupport(), and Auth_OpenID_setNoMathSupport().

Referenced by Auth_OpenID_DiffieHellmanSHA1ServerSession\answer(), Auth_OpenID_DiffieHellman\Auth_OpenID_DiffieHellman(), Auth_OpenID_include_init(), Auth_OpenID_DiffieHellmanSHA1ConsumerSession\extractSecret(), Auth_OpenID_DiffieHellmanSHA1ServerSession\getDH(), and Auth_OpenID_DiffieHellmanSHA1ConsumerSession\getRequest().

{
// The instance of Auth_OpenID_MathWrapper that we choose to
// supply will be stored here, so that subseqent calls to this
// method will return a reference to the same object.
static $lib = null;
if (isset($lib)) {
return $lib;
}
$null = null;
return $null;
}
// If this method has not been called before, look at
// Auth_OpenID_math_extensions and try to find an extension that
// works.
if ($ext === false) {
$tried = array();
foreach (Auth_OpenID_math_extensions() as $extinfo) {
$tried[] = $extinfo['extension'];
}
$triedstr = implode(", ", $tried);
$result = null;
return $result;
}
// Instantiate a new wrapper
$class = $ext['class'];
$lib = new $class();
return $lib;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_math_extensions ( )

Define the supported extensions.

An extension array has keys 'modules', 'extension', and 'class'. 'modules' is an array of PHP module names which the loading code will attempt to load. These values will be suffixed with a library file extension (e.g. ".so"). 'extension' is the name of a PHP extension which will be tested before 'modules' are loaded. 'class' is the string name of a Auth_OpenID_MathWrapper subclass which should be instantiated if a given extension is present.

You can define new math library implementations and add them to this array.

Definition at line 343 of file BigMath.php.

References $result.

Referenced by Auth_OpenID_getMathLib().

{
$result = array();
if (!defined('Auth_OpenID_BUGGY_GMP')) {
$result[] =
array('modules' => array('gmp', 'php_gmp'),
'extension' => 'gmp',
'class' => 'Auth_OpenID_GmpMathWrapper');
}
$result[] = array('modules' => array('bcmath', 'php_bcmath'),
'extension' => 'bcmath',
'class' => 'Auth_OpenID_BcMathWrapper');
return $result;
}

+ Here is the caller graph for this function:

Auth_OpenID_noMathSupport ( )

Definition at line 447 of file BigMath.php.

Referenced by Auth_OpenID_getDefaultAssociationOrder(), and Auth_OpenID_getMathLib().

{
return defined('Auth_OpenID_NO_MATH_SUPPORT');
}

+ Here is the caller graph for this function:

Auth_OpenID_setNoMathSupport ( )

Definition at line 440 of file BigMath.php.

Referenced by Auth_OpenID_getMathLib(), and Auth_OpenID_include_init().

{
if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
define('Auth_OpenID_NO_MATH_SUPPORT', true);
}
}

+ Here is the caller graph for this function: