web/lib/Zend/Serializer/Adapter/Igbinary.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Serializer
    16  * @package    Zend_Serializer
    17  * @subpackage Adapter
    17  * @subpackage Adapter
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Igbinary.php 20574 2010-01-24 17:39:14Z mabe $
    20  * @version    $Id: Igbinary.php 24593 2012-01-05 20:35:02Z matthew $
    21  */
    21  */
    22 
    22 
    23 /** @see Zend_Serializer_Adapter_AdapterAbstract */
    23 /** @see Zend_Serializer_Adapter_AdapterAbstract */
    24 require_once 'Zend/Serializer/Adapter/AdapterAbstract.php';
    24 require_once 'Zend/Serializer/Adapter/AdapterAbstract.php';
    25 
    25 
    26 /**
    26 /**
    27  * @category   Zend
    27  * @category   Zend
    28  * @package    Zend_Serializer
    28  * @package    Zend_Serializer
    29  * @subpackage Adapter
    29  * @subpackage Adapter
    30  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    30  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    31  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  */
    32  */
    33 class Zend_Serializer_Adapter_Igbinary extends Zend_Serializer_Adapter_AdapterAbstract
    33 class Zend_Serializer_Adapter_Igbinary extends Zend_Serializer_Adapter_AdapterAbstract
    34 {
    34 {
    35     /**
    35     /**
    37      */
    37      */
    38     private static $_serializedNull = null;
    38     private static $_serializedNull = null;
    39 
    39 
    40     /**
    40     /**
    41      * Constructor
    41      * Constructor
    42      * 
    42      *
    43      * @param  array|Zend_Config $opts 
    43      * @param  array|Zend_Config $opts
    44      * @return void
    44      * @return void
    45      * @throws Zend_Serializer_Exception If igbinary extension is not present
    45      * @throws Zend_Serializer_Exception If igbinary extension is not present
    46      */
    46      */
    47     public function __construct($opts = array()) 
    47     public function __construct($opts = array())
    48     {
    48     {
    49         if (!extension_loaded('igbinary')) {
    49         if (!extension_loaded('igbinary')) {
    50             require_once 'Zend/Serializer/Exception.php';
    50             require_once 'Zend/Serializer/Exception.php';
    51             throw new Zend_Serializer_Exception('PHP extension "igbinary" is required for this adapter');
    51             throw new Zend_Serializer_Exception('PHP extension "igbinary" is required for this adapter');
    52         }
    52         }
    58         }
    58         }
    59     }
    59     }
    60 
    60 
    61     /**
    61     /**
    62      * Serialize PHP value to igbinary
    62      * Serialize PHP value to igbinary
    63      * 
    63      *
    64      * @param  mixed $value 
    64      * @param  mixed $value
    65      * @param  array $opts 
    65      * @param  array $opts
    66      * @return string
    66      * @return string
    67      * @throws Zend_Serializer_Exception on igbinary error
    67      * @throws Zend_Serializer_Exception on igbinary error
    68      */
    68      */
    69     public function serialize($value, array $opts = array())
    69     public function serialize($value, array $opts = array())
    70     {
    70     {
    77         return $ret;
    77         return $ret;
    78     }
    78     }
    79 
    79 
    80     /**
    80     /**
    81      * Deserialize igbinary string to PHP value
    81      * Deserialize igbinary string to PHP value
    82      * 
    82      *
    83      * @param  string|binary $serialized 
    83      * @param  string|binary $serialized
    84      * @param  array $opts 
    84      * @param  array $opts
    85      * @return mixed
    85      * @return mixed
    86      * @throws Zend_Serializer_Exception on igbinary error
    86      * @throws Zend_Serializer_Exception on igbinary error
    87      */
    87      */
    88     public function unserialize($serialized, array $opts = array())
    88     public function unserialize($serialized, array $opts = array())
    89     {
    89     {