JanRain OpenID Library

BigMath.php

BigMath: A math library wrapper that abstracts out the underlying long integer library.

PHP versions 4 and 5

LICENSE: See the COPYING file included in this distribution.

Tags
access

private

author

JanRain, Inc. openid@janrain.com

copyright

2005-2008 Janrain, Inc.

license

http://www.apache.org/licenses/LICENSE-2.0 Apache

Interfaces, Classes, Traits and Enums

Auth_OpenID_MathLibrary
The superclass of all big-integer math implementations
Auth_OpenID_BcMathWrapper
Exposes BCmath math library functionality.
Auth_OpenID_GmpMathWrapper
Exposes GMP math library functionality.

Table of Contents

Auth_OpenID_NO_MATH_SUPPORT  = true
Auth_OpenID_math_extensions()  : mixed
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").
Auth_OpenID_detectMathLibrary()  : bool
Detect which (if any) math library is available
Auth_OpenID_getMathLib()  : Auth_OpenID_MathLibrary|null
{@link Auth_OpenID_getMathLib} checks for the presence of long number extension modules and returns an instance of {@link Auth_OpenID_MathWrapper} which exposes the module's functionality.
Auth_OpenID_setNoMathSupport()  : mixed
Auth_OpenID_noMathSupport()  : mixed

Constants

Auth_OpenID_NO_MATH_SUPPORT

public mixed Auth_OpenID_NO_MATH_SUPPORT = true

Functions

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").

Auth_OpenID_math_extensions() : mixed

'extension' is the name of a PHP extension which will be tested before 'modules' are loaded. 'class' is the string name of a subclass which should be instantiated if a given extension is present.

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

Return values
mixed

Auth_OpenID_detectMathLibrary()

Detect which (if any) math library is available

Auth_OpenID_detectMathLibrary(array<string|int, mixed> $exts) : bool
Parameters
$exts : array<string|int, mixed>
Return values
bool

Auth_OpenID_getMathLib()

{@link Auth_OpenID_getMathLib} checks for the presence of long number extension modules and returns an instance of {@link Auth_OpenID_MathWrapper} which exposes the module's functionality.

Auth_OpenID_getMathLib() : Auth_OpenID_MathLibrary|null

Checks for the existence of an extension module described by the result of and returns an instance of a wrapper for that extension module. If no extension module is found, an instance of is returned, which wraps the native PHP integer implementation. The proper calling convention for this method is $lib = Auth_OpenID_getMathLib().

This function checks for the existence of specific long number implementations in the following order: GMP followed by BCmath.

Return values
Auth_OpenID_MathLibrary|null

Auth_OpenID_setNoMathSupport()

Auth_OpenID_setNoMathSupport() : mixed
Return values
mixed

Auth_OpenID_noMathSupport()

Auth_OpenID_noMathSupport() : mixed
Return values
mixed

Search results