equal
deleted
inserted
replaced
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: Json.php 20574 2010-01-24 17:39:14Z mabe $ |
20 * @version $Id: Json.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 |
28 |
28 |
29 /** |
29 /** |
30 * @category Zend |
30 * @category Zend |
31 * @package Zend_Serializer |
31 * @package Zend_Serializer |
32 * @subpackage Adapter |
32 * @subpackage Adapter |
33 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
33 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
34 * @license http://framework.zend.com/license/new-bsd New BSD License |
34 * @license http://framework.zend.com/license/new-bsd New BSD License |
35 */ |
35 */ |
36 class Zend_Serializer_Adapter_Json extends Zend_Serializer_Adapter_AdapterAbstract |
36 class Zend_Serializer_Adapter_Json extends Zend_Serializer_Adapter_AdapterAbstract |
37 { |
37 { |
38 /** |
38 /** |
44 'objectDecodeType' => Zend_Json::TYPE_ARRAY, |
44 'objectDecodeType' => Zend_Json::TYPE_ARRAY, |
45 ); |
45 ); |
46 |
46 |
47 /** |
47 /** |
48 * Serialize PHP value to JSON |
48 * Serialize PHP value to JSON |
49 * |
49 * |
50 * @param mixed $value |
50 * @param mixed $value |
51 * @param array $opts |
51 * @param array $opts |
52 * @return string |
52 * @return string |
53 * @throws Zend_Serializer_Exception on JSON encoding exception |
53 * @throws Zend_Serializer_Exception on JSON encoding exception |
54 */ |
54 */ |
55 public function serialize($value, array $opts = array()) |
55 public function serialize($value, array $opts = array()) |
56 { |
56 { |
64 } |
64 } |
65 } |
65 } |
66 |
66 |
67 /** |
67 /** |
68 * Deserialize JSON to PHP value |
68 * Deserialize JSON to PHP value |
69 * |
69 * |
70 * @param string $json |
70 * @param string $json |
71 * @param array $opts |
71 * @param array $opts |
72 * @return mixed |
72 * @return mixed |
73 */ |
73 */ |
74 public function unserialize($json, array $opts = array()) |
74 public function unserialize($json, array $opts = array()) |
75 { |
75 { |
76 $opts = $opts + $this->_options; |
76 $opts = $opts + $this->_options; |