This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
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
81 parents
9c11872
+
484fecb
+
17ed9ab
+
9881dbb
+
6d7f5ab
+
561ef2b
+
567588e
+
ec0d061
+
3a9c051
+
ffadf7b
+
8c8ab46
+
56dffee
+
9b3291e
+
72011a1
+
79d20ae
+
0023b68
+
203219a
+
51f1e65
+
adba36a
+
48704a6
+
3ed141c
+
a79cdbd
+
73871a0
+
47d468d
+
538d0f4
+
b5ad75a
+
2363c4f
+
91c2337
+
04dcb58
+
906c7b6
+
0da7bb6
+
0270a77
+
6784c86
+
90d950a
+
3b5ea7f
+
339830e
+
b04f4d5
+
8da9d32
+
0e2a882
+
f0829e4
+
c66d3bb
+
c44c042
+
e2121f5
+
19560b1
+
f08a210
+
294332a
+
3ab34f5
+
bb64c7d
+
b204532
+
1e8aff5
+
da2423f
+
7fce745
+
6c8026c
+
a449c92
+
c9f86d3
+
b2b0ea1
+
3b554ac
+
4deeef8
+
c6f5d24
+
fdaf0f2
+
6047973
+
66f79d5
+
ef273f8
+
6c44bc5
+
ddae1cc
+
24b691f
+
b2ba0b2
+
3df4d2a
+
d37df59
+
7f0c1ad
+
25ddb64
+
61dafd7
+
6eb1418
+
72e4c73
+
fc0f217
+
05d994b
+
386083b
+
7890c16
+
07c51ae
+
a62d81b
+
53960c5
commit 3521702
Showing
60 changed files
with
714 additions
and
1,315 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
{ | ||
"name": "zendframework/zend-xml-rpc", | ||
"description": "Zend\\XmlRpc component", | ||
"name": "zendframework/zend-xmlrpc", | ||
"description": " ", | ||
"license": "BSD-3-Clause", | ||
"keywords": [ | ||
"zf2", | ||
"xml-rpc" | ||
"xmlrpc" | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Zend\\XmlRpc\\": "src/" | ||
"Zend\\XmlRpc": "src/" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=5.3.23" | ||
}, | ||
"require-dev": { | ||
"fabpot/php-cs-fixer": "1.7.*", | ||
"satooshi/php-coveralls": "dev-master", | ||
"phpunit/PHPUnit": "~4.0" | ||
"php": ">=5.3.3", | ||
"zendframework/zend-http": "self.version", | ||
"zendframework/zend-math": "self.version", | ||
"zendframework/zend-server": "self.version" | ||
}, | ||
"homepage": "https://github.com/zendframework/zend-xml-rpc", | ||
"autoload-dev": { | ||
"psr-4": { | ||
"ZendTest\\XmlRpc\\": "test/" | ||
} | ||
}, | ||
"require-dev": { | ||
"fabpot/php-cs-fixer": "1.7.*", | ||
"satooshi/php-coveralls": "dev-master", | ||
"phpunit/PHPUnit": "~4.0" | ||
} | ||
} |
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,28 +1,16 @@ | ||
<?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_XmlRpc | ||
* @subpackage Value | ||
* @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 http://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_XmlRpc | ||
*/ | ||
|
||
namespace Zend\XmlRpc; | ||
|
||
use DateTime; | ||
use Zend\Date; | ||
use Zend\Math\BigInteger; | ||
|
||
/** | ||
|
@@ -36,10 +24,8 @@ | |
* from PHP variables, XML string or by specifing the exact XML-RPC natvie type | ||
* | ||
* @package Zend_XmlRpc | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
abstract class Value | ||
abstract class AbstractValue | ||
{ | ||
/** | ||
* The native XML-RPC representation of this object's value | ||
|
@@ -188,7 +174,7 @@ public function generateXml() | |
* | ||
* @param mixed $value | ||
* @param Zend\XmlRpc\Value::constant $type | ||
* @return Value | ||
* @return AbstractValue | ||
*/ | ||
public static function getXmlRpcValue($value, $type = self::AUTO_DETECT_TYPE) | ||
{ | ||
|
@@ -252,9 +238,9 @@ public static function getXmlRpcValue($value, $type = self::AUTO_DETECT_TYPE) | |
public static function getXmlRpcTypeByValue($value) | ||
{ | ||
if (is_object($value)) { | ||
if ($value instanceof Value) { | ||
if ($value instanceof AbstractValue) { | ||
return $value->getType(); | ||
} elseif (($value instanceof Date\Date) || ($value instanceof DateTime)) { | ||
} elseif ($value instanceof DateTime) { | ||
return self::XMLRPC_TYPE_DATETIME; | ||
} | ||
return self::getXmlRpcTypeByValue(get_object_vars($value)); | ||
|
@@ -285,14 +271,14 @@ public static function getXmlRpcTypeByValue($value) | |
* | ||
* @param mixed $value The PHP variable for convertion | ||
* | ||
* @return Value | ||
* @return AbstractValue | ||
* @static | ||
*/ | ||
protected static function _phpVarToNativeXmlRpc($value) | ||
{ | ||
// @see http://framework.zend.com/issues/browse/ZF-8623 | ||
if (is_object($value)) { | ||
if ($value instanceof Value) { | ||
if ($value instanceof AbstractValue) { | ||
return $value; | ||
} | ||
if ($value instanceof BigInteger) { | ||
|
@@ -304,8 +290,7 @@ protected static function _phpVarToNativeXmlRpc($value) | |
} | ||
} | ||
|
||
switch (self::getXmlRpcTypeByValue($value)) | ||
{ | ||
switch (self::getXmlRpcTypeByValue($value)) { | ||
case self::XMLRPC_TYPE_DATETIME: | ||
return new Value\DateTime($value); | ||
|
||
|
@@ -341,7 +326,7 @@ protected static function _phpVarToNativeXmlRpc($value) | |
* @param string|SimpleXMLElement $xml A SimpleXMLElement object represent the XML string | ||
* It can be also a valid XML string for convertion | ||
* | ||
* @return Zend\XmlRpc\Value\Value | ||
* @return Zend\XmlRpc\Value\AbstractValue | ||
* @static | ||
*/ | ||
protected static function _xmlStringToNativeXmlRpc($xml) | ||
|
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,38 +1,25 @@ | ||
<?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_XmlRpc | ||
* @subpackage Client | ||
* @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 http://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_XmlRpc | ||
*/ | ||
|
||
namespace Zend\XmlRpc; | ||
|
||
use Zend\Http, | ||
Zend\Server\Client as ServerClient, | ||
Zend\XmlRpc\Value; | ||
use Zend\Http; | ||
use Zend\Server\Client as ServerClient; | ||
use Zend\XmlRpc\AbstractValue; | ||
|
||
/** | ||
* An XML-RPC client implementation | ||
* | ||
* @category Zend | ||
* @package Zend_XmlRpc | ||
* @subpackage Client | ||
* @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 Client implements ServerClient | ||
{ | ||
|
@@ -223,11 +210,11 @@ public function doRequest($request, $response = null) | |
|
||
$http = $this->getHttpClient(); | ||
$httpRequest = $http->getRequest(); | ||
if ($httpRequest->getUri() === null) { | ||
if ($httpRequest->getUriString() === null) { | ||
$http->setUri($this->_serverAddress); | ||
} | ||
|
||
$headers = $httpRequest->headers(); | ||
$headers = $httpRequest->getHeaders(); | ||
$headers->addHeaders(array( | ||
'Content-Type: text/xml; charset=utf-8', | ||
'Accept: text/xml', | ||
|
@@ -280,28 +267,28 @@ public function call($method, $params=array()) | |
} | ||
if ($success) { | ||
$validTypes = array( | ||
Value::XMLRPC_TYPE_ARRAY, | ||
Value::XMLRPC_TYPE_BASE64, | ||
Value::XMLRPC_TYPE_BOOLEAN, | ||
Value::XMLRPC_TYPE_DATETIME, | ||
Value::XMLRPC_TYPE_DOUBLE, | ||
Value::XMLRPC_TYPE_I4, | ||
Value::XMLRPC_TYPE_INTEGER, | ||
Value::XMLRPC_TYPE_NIL, | ||
Value::XMLRPC_TYPE_STRING, | ||
Value::XMLRPC_TYPE_STRUCT, | ||
AbstractValue::XMLRPC_TYPE_ARRAY, | ||
AbstractValue::XMLRPC_TYPE_BASE64, | ||
AbstractValue::XMLRPC_TYPE_BOOLEAN, | ||
AbstractValue::XMLRPC_TYPE_DATETIME, | ||
AbstractValue::XMLRPC_TYPE_DOUBLE, | ||
AbstractValue::XMLRPC_TYPE_I4, | ||
AbstractValue::XMLRPC_TYPE_INTEGER, | ||
AbstractValue::XMLRPC_TYPE_NIL, | ||
AbstractValue::XMLRPC_TYPE_STRING, | ||
AbstractValue::XMLRPC_TYPE_STRUCT, | ||
); | ||
|
||
if (!is_array($params)) { | ||
$params = array($params); | ||
} | ||
foreach ($params as $key => $param) { | ||
if ($param instanceof Value) { | ||
if ($param instanceof AbstractValue) { | ||
continue; | ||
} | ||
|
||
if (count($signatures) > 1) { | ||
$type = Value::getXmlRpcTypeByValue($param); | ||
$type = AbstractValue::getXmlRpcTypeByValue($param); | ||
foreach ($signatures as $signature) { | ||
if (!is_array($signature)) { | ||
continue; | ||
|
@@ -319,10 +306,10 @@ public function call($method, $params=array()) | |
} | ||
|
||
if (empty($type) || !in_array($type, $validTypes)) { | ||
$type = Value::AUTO_DETECT_TYPE; | ||
$type = AbstractValue::AUTO_DETECT_TYPE; | ||
} | ||
|
||
$params[$key] = Value::getXmlRpcValue($param, $type); | ||
$params[$key] = AbstractValue::getXmlRpcValue($param, $type); | ||
} | ||
} | ||
} | ||
|
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_XmlRpc | ||
* @subpackage Client | ||
* @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 http://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_XmlRpc | ||
*/ | ||
|
||
namespace Zend\XmlRpc\Client\Exception; | ||
|
@@ -29,8 +18,7 @@ | |
* @category Zend | ||
* @package Zend_XmlRpc | ||
* @subpackage Client | ||
* @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 extends Exception | ||
{} | ||
{ | ||
} |
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_XmlRpc | ||
* @subpackage Client | ||
* @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 http://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_XmlRpc | ||
*/ | ||
|
||
namespace Zend\XmlRpc\Client\Exception; | ||
|
@@ -29,10 +18,7 @@ | |
* @category Zend | ||
* @package Zend_XmlRpc | ||
* @subpackage Client | ||
* @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 FaultException | ||
extends Exception\BadMethodCallException | ||
implements ExceptionInterface | ||
{} | ||
class FaultException extends Exception\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,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_XmlRpc | ||
* @subpackage Client | ||
* @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 http://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_XmlRpc | ||
*/ | ||
|
||
namespace Zend\XmlRpc\Client\Exception; | ||
|
@@ -28,9 +17,7 @@ | |
* @category Zend | ||
* @package Zend_XmlRpc | ||
* @subpackage Client | ||
* @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 HttpException | ||
extends RuntimeException | ||
{} | ||
class HttpException extends RuntimeException | ||
{ | ||
} |
Oops, something went wrong.