web/lib/Zend/Crypt/Math/BigInteger.php
author Raphael Velt <raph.velt@gmail.com>
Mon, 15 Apr 2013 13:24:29 +0200
changeset 847 ed643ad4d8bf
parent 807 877f952ae2bd
child 1230 68c69c656a2c
permissions -rw-r--r--
debug mode

<?php
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Crypt
 * @subpackage Math
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: BigInteger.php 24593 2012-01-05 20:35:02Z matthew $
 */

/**
 * Support for arbitrary precision mathematics in PHP.
 *
 * Zend_Crypt_Math_BigInteger is a wrapper across three PHP extensions: bcmath, gmp
 * and big_int. Since each offer similar functionality, but availability of
 * each differs across installations of PHP, this wrapper attempts to select
 * the fastest option available and encapsulate a subset of its functionality
 * which all extensions share in common.
 *
 * This class requires one of the three extensions to be available. BCMATH
 * while the slowest, is available by default under Windows, and under Unix
 * if PHP is compiled with the flag "--enable-bcmath". GMP requires the gmp
 * library from http://www.swox.com/gmp/ and PHP compiled with the "--with-gmp"
 * flag. BIG_INT support is available from a big_int PHP library available from
 * only from PECL (a Windows port is not available).
 *
 * @category   Zend
 * @package    Zend_Crypt
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Crypt_Math_BigInteger
{

    /**
     * Holds an instance of one of the three arbitrary precision wrappers.
     *
     * @var Zend_Crypt_Math_BigInteger_Interface
     */
    protected $_math = null;

    /**
     * Constructor; a Factory which detects a suitable PHP extension for
     * arbitrary precision math and instantiates the suitable wrapper
     * object.
     *
     * @param string $extension
     * @throws  Zend_Crypt_Math_BigInteger_Exception
     */
    public function __construct($extension = null)
    {
        if ($extension !== null && !in_array($extension, array('bcmath', 'gmp', 'bigint'))) {
            require_once('Zend/Crypt/Math/BigInteger/Exception.php');
            throw new Zend_Crypt_Math_BigInteger_Exception('Invalid extension type; please use one of bcmath, gmp or bigint');
        }
        $this->_loadAdapter($extension);
    }

    /**
     * Redirect all public method calls to the wrapped extension object.
     *
     * @param   string $methodName
     * @param   array $args
     * @throws  Zend_Crypt_Math_BigInteger_Exception
     */
    public function __call($methodName, $args)
    {
        if(!method_exists($this->_math, $methodName)) {
            require_once 'Zend/Crypt/Math/BigInteger/Exception.php';
            throw new Zend_Crypt_Math_BigInteger_Exception('invalid method call: ' . get_class($this->_math) . '::' . $methodName . '() does not exist');
        }
        return call_user_func_array(array($this->_math, $methodName), $args);
    }

    /**
     * @param string $extension
     * @throws  Zend_Crypt_Math_BigInteger_Exception
     */
    protected function _loadAdapter($extension = null)
    {
        if ($extension === null) {
            if (extension_loaded('gmp')) {
                $extension = 'gmp';
            //} elseif (extension_loaded('big_int')) {
            //    $extension = 'big_int';
            } else {
                $extension = 'bcmath';
            }
        }
        if($extension == 'gmp' && extension_loaded('gmp')) {
            require_once 'Zend/Crypt/Math/BigInteger/Gmp.php';
            $this->_math = new Zend_Crypt_Math_BigInteger_Gmp();
        //} elseif($extension == 'bigint' && extension_loaded('big_int')) {
        //    require_once 'Zend/Crypt_Math/BigInteger/Bigint.php';
        //    $this->_math = new Zend_Crypt_Math_BigInteger_Bigint();
        } elseif ($extension == 'bcmath' && extension_loaded('bcmath')) {
            require_once 'Zend/Crypt/Math/BigInteger/Bcmath.php';
            $this->_math = new Zend_Crypt_Math_BigInteger_Bcmath();
        } else {
            require_once 'Zend/Crypt/Math/BigInteger/Exception.php';
            throw new Zend_Crypt_Math_BigInteger_Exception($extension . ' big integer precision math support not detected');
        }
    }

}
PKJCB+ egonomy-9ce87d383c85/integration/v2/.keepmeUTHQPKJCB0HY(0 degonomy-9ce87d383c85/integration/v2/01-home.htmlUTHQPKJCBS.279 $egonomy-9ce87d383c85/integration/v2/02-collectionner.htmlUTHQPKJCBeex!egonomy-9ce87d383c85/integration/v2/13-detail_image.htmlUTHQPKJCB^-&= 큊Eegonomy-9ce87d383c85/integration/v2/14-creation_fragment.htmlUTHQPKJCB 7> Negonomy-9ce87d383c85/integration/v2/15-16-detail_fragment.htmlUTHQPKJCBL9 WL 큗Xegonomy-9ce87d383c85/integration/v2/18-19-20-21-collection_vue_mosaique.htmlUTHQPKJCBc@k.C -cegonomy-9ce87d383c85/integration/v2/23-collection_geographique.htmlUTHQPKJCB!ym&1 jegonomy-9ce87d383c85/integration/v2/css/fonts.cssUTHQPKJCB kK$V negonomy-9ce87d383c85/integration/v2/css/fonts/Josefin/JosefinSansStd-Light-webfont.eotUTHQPKJCB(b([V egonomy-9ce87d383c85/integration/v2/css/fonts/Josefin/JosefinSansStd-Light-webfont.svgUTHQPKJCBz+ KPV egonomy-9ce87d383c85/integration/v2/css/fonts/Josefin/JosefinSansStd-Light-webfont.ttfUTHQPKJCBN#7LTLW 큛.egonomy-9ce87d383c85/integration/v2/css/fonts/Josefin/JosefinSansStd-Light-webfont.woffUTHQPKJCBq(;fMMV `{egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bold-webfont.eotUTHQPKJCBi@V Segonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bold-webfont.svgUTHQPKJCB:9XV egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bold-webfont.ttfUTHQPKJCB}ZYYW #degonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bold-webfont.woffUTHQPKJCBegonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bolditalic-webfont.eotUTHQPKJCBsjI$\ egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-bolditalic-webfont.svgUTHQPKJCBegonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-italic-webfont.woffUTHQPKJCBPnL"LW egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-light-webfont.eotUTHQPKJCBqyCzW oegonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-light-webfont.svgUTHQPKJCB,:(=WTW v9egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-light-webfont.ttfUTHQPKJCBk%XIDY 큝egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-regular-webfont.svgUTHQPKJCBvAWtY /egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-regular-webfont.ttfUTHQPKJCBcXk@rV egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thin-webfont.svgUTHQPKJCB^-9TV egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thin-webfont.ttfUTHQPKJCB,p[UUW N egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thin-webfont.woffUTHQPKJCBYZ\ egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thinitalic-webfont.eotUTHQPKJCB{'g J\ Y egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thinitalic-webfont.svgUTHQPKJCBT4vft\ Hegonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thinitalic-webfont.ttfUTHQPKJCB9}8g`g] egonomy-9ce87d383c85/integration/v2/css/fonts/josefinsans/josefinsans-thinitalic-webfont.woffUTHQPKJCB-FZ@U·G egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bla-webfont.eotUTHQPKJCBz߄BG megonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bla-webfont.svgUTHQPKJCB #UG egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bla-webfont.ttfUTHQPKJCB+.UUH 큤egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bla-webfont.woffUTHQPKJCB<^•J \egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BlaIta-webfont.eotUTHQPKJCB*%|FvJ 7egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BlaIta-webfont.svgUTHQPKJCBacm^̔J egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BlaIta-webfont.ttfUTHQPKJCBGyj^^K aegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BlaIta-webfont.woffUTHQPKJCBZG egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bol-webfont.eotUTHQPKJCBe4AVAG ]egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bol-webfont.svgUTHQPKJCBaՊYĊG 1]egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bol-webfont.ttfUTHQPKJCB<YYH Iegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Bol-webfont.woffUTHQPKJCBH aJ negonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BolIta-webfont.eotUTHQPKJCBHiFJ 큆segonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BolIta-webfont.svgUTHQPKJCB)a$J ˺egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BolIta-webfont.ttfUTHQPKJCB p`PaK uegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-BolIta-webfont.woffUTHQPKJCB/UG }egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Hai-webfont.eotUTHQPKJCB_>=vG 큂egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Hai-webfont.svgUTHQPKJCBT̋G >egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Hai-webfont.ttfUTHQPKJCBa'U\UH [fegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Hai-webfont.woffUTHQPKJCB[rϲ^bJ egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-HaiIta-webfont.eotUTHQPKJCBG[C/J egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-HaiIta-webfont.svgUTHQPKJCBzTf^`J ^egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-HaiIta-webfont.ttfUTHQPKJCBԙY9^^K 큒egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-HaiIta-webfont.woffUTHQPKJCBV`2X2G Megonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Lig-webfont.eotUTHQPKJCBl\Au@hG 큄uegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Lig-webfont.svgUTHQPKJCB ,;XXG wegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Lig-webfont.ttfUTHQPKJCBexXXH 0egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Lig-webfont.woffUTHQPKJCB]aRJ 'hegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-LigIta-webfont.eotUTHQPKJCBE9J 큎egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-LigIta-webfont.svgUTHQPKJCBgLda\J 큨egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-LigIta-webfont.ttfUTHQPKJCBghQaaK 큍regonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-LigIta-webfont.woffUTHQPKJCB+/HYY:G `egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Reg-webfont.eotUTHQPKJCBK[zARG 7.egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Reg-webfont.svgUTHQPKJCBByXXG /pegonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Reg-webfont.ttfUTHQPKJCBˊYPYH 큒egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-Reg-webfont.woffUTHQPKJCB=V7WcJ #egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-RegIta-webfont.eotUTHQPKJCBV"FJ egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-RegIta-webfont.svgUTHQPKJCB }/+bJ egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-RegIta-webfont.ttfUTHQPKJCBgb8cK x1egonomy-9ce87d383c85/integration/v2/css/fonts/lato/Lato-RegIta-webfont.woffUTHQPKJCB.2a1 הegonomy-9ce87d383c85/integration/v2/css/reset.cssUTHQPKJCBtm3 5 їegonomy-9ce87d383c85/integration/v2/css/slideshow.cssUTHQPKJCB}= N1 pegonomy-9ce87d383c85/integration/v2/css/style.cssUTHQPKJCB͓t 0 egonomy-9ce87d383c85/integration/v2/gabarit.htmlUTHQPKJCB}3 5 egonomy-9ce87d383c85/integration/v2/img/113x113-2.pngUTHQPKJCBb2>V4V3 -;egonomy-9ce87d383c85/integration/v2/img/113x113.pngUTHQPKJCBU -rr3 Ցegonomy-9ce87d383c85/integration/v2/img/177x224.pngUTHQPKJCB9BCC3 <egonomy-9ce87d383c85/integration/v2/img/177x232.pngUTHQPKJCB[]3 H egonomy-9ce87d383c85/integration/v2/img/177x264.pngUTHQPKJCBH09+:3 X!egonomy-9ce87d383c85/integration/v2/img/225x225.pngUTHQPKJCBUX3 "egonomy-9ce87d383c85/integration/v2/img/225x297.pngUTHQPKJCBNvD ZY3 s$egonomy-9ce87d383c85/integration/v2/img/378x600.pngUTHQPKJCB33 _)egonomy-9ce87d383c85/integration/v2/img/469x295.pngUTHQPKJCBK8 ,egonomy-9ce87d383c85/integration/v2/img/arrow-select.pngUTHQPKJCB < ,egonomy-9ce87d383c85/integration/v2/img/border-bar-tools.pngUTHQPKJCBnAhD@ ",egonomy-9ce87d383c85/integration/v2/img/border-bottom-header.pngUTHQPKJCBaqB 5: ,egonomy-9ce87d383c85/integration/v2/img/border-dot-bar.pngUTHQPKJCB8ax6 >,egonomy-9ce87d383c85/integration/v2/img/border-dot.pngUTHQPKJCBw,7 `,egonomy-9ce87d383c85/integration/v2/img/close-popin.pngUTHQPKJCB#6 ,egonomy-9ce87d383c85/integration/v2/img/home-arrow.pngUTHQPKww{<%,