This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/zendframework/zf2
- Loading branch information
75 parents
4b50c8a
+
e4fa7ad
+
efc7cf5
+
0f33a2d
+
a3589c7
+
3ddf1a3
+
d86b089
+
491f302
+
c0efd18
+
f9e572c
+
3077af2
+
a811b75
+
585f923
+
9b385ff
+
ec1f853
+
b1a5d58
+
a1cf97e
+
c1b8314
+
1482b41
+
7d80b85
+
869bbf8
+
403ce8d
+
008804b
+
87522da
+
d31ec42
+
2f2a15a
+
585cc82
+
a9438e2
+
d59be1f
+
643e2df
+
a49e8f2
+
08fd26d
+
b52d5dc
+
de5abc1
+
48f2d19
+
34ca3a0
+
5169094
+
25abd15
+
baa09a1
+
355680a
+
b2b0d91
+
6986810
+
7b1513c
+
6f9a6cc
+
39a1c1e
+
92dbdb3
+
ac3a5aa
+
ee15c3a
+
67f414a
+
49138fb
+
a4ebc7b
+
6b11637
+
f128e27
+
41746af
+
cc083fe
+
3d54828
+
ccb0392
+
a8ab5b0
+
1128b0c
+
b5ca6d2
+
bfcf88b
+
e2e6ee0
+
bd53446
+
62fffaa
+
075b3a5
+
dfc876b
+
2056187
+
ccaac9b
+
5088038
+
5ef536e
+
6878fa7
+
66a7225
+
869024d
+
82f5ac4
+
a831196
commit dde75d7
Showing
36 changed files
with
382 additions
and
772 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json; | ||
|
||
use Zend\Json\Exception\RuntimeException, | ||
Zend\Json\Exception\InvalidArgumentException; | ||
use Zend\Json\Exception\InvalidArgumentException; | ||
use Zend\Json\Exception\RuntimeException; | ||
|
||
/** | ||
* Decode JSON encoded string to PHP variable constructs | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @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 Decoder | ||
{ | ||
|
@@ -474,7 +462,13 @@ public static function decodeUnicodeString($chrs) | |
// single, escaped unicode character | ||
$utf16 = chr(hexdec(substr($chrs, ($i + 2), 2))) | ||
. chr(hexdec(substr($chrs, ($i + 4), 2))); | ||
$utf8 .= self::_utf162utf8($utf16); | ||
$utf8char = self::_utf162utf8($utf16); | ||
$search = array('\\', "\n", "\t", "\r", chr(0x08), chr(0x0C), '"', '\'', '/'); | ||
if (in_array($utf8char, $search)) { | ||
$replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"', '\\\'', '\\/'); | ||
$utf8char = str_replace($search, $replace, $utf8char); | ||
} | ||
$utf8 .= $utf8char; | ||
$i += 5; | ||
break; | ||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): | ||
|
@@ -562,4 +556,3 @@ protected static function _utf162utf8($utf16) | |
return ''; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json; | ||
|
||
use Zend\Json\Exception\RecursionException, | ||
Zend\Json\Exception\InvalidArgumentException; | ||
use Zend\Json\Exception\InvalidArgumentException; | ||
use Zend\Json\Exception\RecursionException; | ||
|
||
/** | ||
* Encode PHP constructs to JSON | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @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 Encoder | ||
{ | ||
|
@@ -96,7 +84,7 @@ protected function _encodeValue(&$value) | |
{ | ||
if (is_object($value)) { | ||
return $this->_encodeObject($value); | ||
} else if (is_array($value)) { | ||
} elseif (is_array($value)) { | ||
return $this->_encodeArray($value); | ||
} | ||
|
||
|
@@ -160,7 +148,7 @@ protected function _encodeObject(&$value) | |
} | ||
|
||
$className = get_class($value); | ||
return '{"__className":' | ||
return '{"__className":' | ||
. $this->_encodeString($className) | ||
. $props . '}'; | ||
} | ||
|
@@ -260,10 +248,10 @@ protected function _encodeDatum(&$value) | |
*/ | ||
protected function _encodeString(&$string) | ||
{ | ||
// Escape these characters with a backslash: | ||
// Escape these characters with a backslash or unicode escape: | ||
// " \ / \n \r \t \b \f | ||
$search = array('\\', "\n", "\t", "\r", "\b", "\f", '"', '/'); | ||
$replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"', '\\/'); | ||
$search = array('\\', "\n", "\t", "\r", "\b", "\f", '"', '\'', '&', '<', '>', '/'); | ||
$replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\\u0022', '\\u0027', '\\u0026', '\\u003C', '\\u003E', '\\/'); | ||
$string = str_replace($search, $replace, $string); | ||
|
||
// Escape certain ASCII characters: | ||
|
@@ -580,4 +568,3 @@ protected static function _utf82utf16($utf8) | |
return ''; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @subpackage Exception | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json\Exception; | ||
|
@@ -25,9 +14,7 @@ | |
* @category Zend | ||
* @package Zend_Json | ||
* @subpackage Exception | ||
* @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 BadMethodCallException extends \BadMethodCallException implements | ||
class BadMethodCallException extends \BadMethodCallException implements | ||
ExceptionInterface | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface ExceptionInterface | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Json | ||
* @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 InvalidArgumentException | ||
extends \InvalidArgumentException | ||
implements ExceptionInterface | ||
class InvalidArgumentException extends \InvalidArgumentException implements | ||
ExceptionInterface | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Json | ||
* @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 RecursionException extends RuntimeException | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Json | ||
* @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 RuntimeException | ||
extends \RuntimeException | ||
implements ExceptionInterface | ||
class RuntimeException extends \RuntimeException implements ExceptionInterface | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Json | ||
* @subpackage Expr | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link https://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Json | ||
*/ | ||
|
||
namespace Zend\Json; | ||
|
@@ -46,8 +35,6 @@ | |
* @category Zend | ||
* @package Zend_Json | ||
* @subpackage Expr | ||
* @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 Expr | ||
{ | ||
|
Oops, something went wrong.