Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Zend_Crypt_Math_BigInteger Class Reference
Inheritance diagram for Zend_Crypt_Math_BigInteger:
Zend_Crypt_Math

Public Member Functions

 __construct ($extension=null)
 
 __call ($methodName, $args)
 

Protected Member Functions

 _loadAdapter ($extension=null)
 

Protected Attributes

 $_math = null
 

Detailed Description

Definition at line 44 of file BigInteger.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $extension = null)

Constructor; a Factory which detects a suitable PHP extension for arbitrary precision math and instantiates the suitable wrapper object.

Parameters
string$extension
Exceptions
Zend_Crypt_Math_BigInteger_Exception

Definition at line 62 of file BigInteger.php.

63  {
64  if ($extension !== null && !in_array($extension, array('bcmath', 'gmp', 'bigint'))) {
65  #require_once('Zend/Crypt/Math/BigInteger/Exception.php');
66  throw new Zend_Crypt_Math_BigInteger_Exception('Invalid extension type; please use one of bcmath, gmp or bigint');
67  }
68  $this->_loadAdapter($extension);
69  }
_loadAdapter($extension=null)
Definition: BigInteger.php:92

Member Function Documentation

◆ __call()

__call (   $methodName,
  $args 
)

Redirect all public method calls to the wrapped extension object.

Parameters
string$methodName
array$args
Returns
mixed
Exceptions
Zend_Crypt_Math_BigInteger_Exception

Definition at line 79 of file BigInteger.php.

80  {
81  if(!method_exists($this->_math, $methodName)) {
82  #require_once 'Zend/Crypt/Math/BigInteger/Exception.php';
83  throw new Zend_Crypt_Math_BigInteger_Exception('invalid method call: ' . get_class($this->_math) . '::' . $methodName . '() does not exist');
84  }
85  return call_user_func_array(array($this->_math, $methodName), $args);
86  }

◆ _loadAdapter()

_loadAdapter (   $extension = null)
protected
Parameters
string$extension
Exceptions
Zend_Crypt_Math_BigInteger_Exception

Definition at line 92 of file BigInteger.php.

93  {
94  if ($extension === null) {
95  if (extension_loaded('gmp')) {
96  $extension = 'gmp';
97  //} elseif (extension_loaded('big_int')) {
98  // $extension = 'big_int';
99  } else {
100  $extension = 'bcmath';
101  }
102  }
103  if($extension == 'gmp' && extension_loaded('gmp')) {
104  #require_once 'Zend/Crypt/Math/BigInteger/Gmp.php';
105  $this->_math = new Zend_Crypt_Math_BigInteger_Gmp();
106  //} elseif($extension == 'bigint' && extension_loaded('big_int')) {
107  // #require_once 'Zend/Crypt_Math/BigInteger/Bigint.php';
108  // $this->_math = new Zend_Crypt_Math_BigInteger_Bigint();
109  } elseif ($extension == 'bcmath' && extension_loaded('bcmath')) {
110  #require_once 'Zend/Crypt/Math/BigInteger/Bcmath.php';
111  $this->_math = new Zend_Crypt_Math_BigInteger_Bcmath();
112  } else {
113  #require_once 'Zend/Crypt/Math/BigInteger/Exception.php';
114  throw new Zend_Crypt_Math_BigInteger_Exception($extension . ' big integer precision math support not detected');
115  }
116  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

Field Documentation

◆ $_math

$_math = null
protected

Definition at line 52 of file BigInteger.php.


The documentation for this class was generated from the following file: