web/lib/Zend/Serializer/Adapter/PhpSerialize.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: PhpSerialize.php 20574 2010-01-24 17:39:14Z mabe $
    20  * @version    $Id: PhpSerialize.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_PhpSerialize extends Zend_Serializer_Adapter_AdapterAbstract
    33 class Zend_Serializer_Adapter_PhpSerialize extends Zend_Serializer_Adapter_AdapterAbstract
    34 {
    34 {
    35     /**
    35     /**
    37      */
    37      */
    38     private static $_serializedFalse = null;
    38     private static $_serializedFalse = 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      */
    45      */
    46     public function __construct($opts = array()) 
    46     public function __construct($opts = array())
    47     {
    47     {
    48         parent::__construct($opts);
    48         parent::__construct($opts);
    49 
    49 
    50         if (self::$_serializedFalse === null) {
    50         if (self::$_serializedFalse === null) {
    51             self::$_serializedFalse = serialize(false);
    51             self::$_serializedFalse = serialize(false);
    52         }
    52         }
    53     }
    53     }
    54 
    54 
    55     /**
    55     /**
    56      * Serialize using serialize()
    56      * Serialize using serialize()
    57      * 
    57      *
    58      * @param  mixed $value 
    58      * @param  mixed $value
    59      * @param  array $opts 
    59      * @param  array $opts
    60      * @return string
    60      * @return string
    61      * @throws Zend_Serializer_Exception On serialize error
    61      * @throws Zend_Serializer_Exception On serialize error
    62      */
    62      */
    63     public function serialize($value, array $opts = array())
    63     public function serialize($value, array $opts = array())
    64     {
    64     {
    71         return $ret;
    71         return $ret;
    72     }
    72     }
    73 
    73 
    74     /**
    74     /**
    75      * Unserialize
    75      * Unserialize
    76      * 
    76      *
    77      * @todo   Allow integration with unserialize_callback_func
    77      * @todo   Allow integration with unserialize_callback_func
    78      * @param  string $serialized 
    78      * @param  string $serialized
    79      * @param  array $opts 
    79      * @param  array $opts
    80      * @return mixed
    80      * @return mixed
    81      * @throws Zend_Serializer_Exception on unserialize error
    81      * @throws Zend_Serializer_Exception on unserialize error
    82      */
    82      */
    83     public function unserialize($serialized, array $opts = array())
    83     public function unserialize($serialized, array $opts = array())
    84     {
    84     {