Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into cach…
Browse files Browse the repository at this point in the history
…e_interfaces
  • Loading branch information
Show file tree
Hide file tree
Showing 30 changed files with 525 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .travis/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
travisdir=$(dirname $(readlink /proc/$$/fd/255))
travisdir=$(dirname "$0")
testdir="$travisdir/../tests"
testedcomponents=(`cat "$travisdir/tested-components"`)
result=0
Expand Down
1 change: 1 addition & 0 deletions .travis/skipped-components
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Zend/Amf
Zend/Date
Zend/Dojo
Zend/Queue
Zend/Service
Zend/Test
Expand Down
4 changes: 3 additions & 1 deletion .travis/tested-components
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ Zend/Form
Zend/GData
Zend/Http
Zend/InfoCard
Zend/InputFilter
Zend/Json
Zend/Ldap
Zend/Loader
Zend/Locale
Zend/Log
Zend/Mail
Zend/Markup
Zend/Math
Zend/Measure
Zend/Memory
Zend/Mime
Zend/Module
Zend/ModuleManager
Zend/Mvc
Zend/Navigation
Zend/OAuth
Expand Down
29 changes: 19 additions & 10 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function doRequest($request, $response = null)
}

$this->_lastResponse = $response;
$this->_lastResponse->loadXml($httpResponse->getBody());
$this->_lastResponse->loadXml(trim($httpResponse->getBody()));
}

/**
Expand Down Expand Up @@ -296,21 +296,30 @@ public function call($method, $params=array())
$params = array($params);
}
foreach ($params as $key => $param) {

if ($param instanceof Value) {
continue;
}

$type = Value::AUTO_DETECT_TYPE;
foreach ($signatures as $signature) {
if (!is_array($signature)) {
continue;
if (count($signatures) > 1) {
$type = Value::getXmlRpcTypeByValue($param);
foreach ($signatures as $signature) {
if (!is_array($signature)) {
continue;
}
if (isset($signature['parameters'][$key])) {
if ($signature['parameters'][$key] == $type) {
break;
}
}
}
} elseif (isset($signatures[0]['parameters'][$key])) {
$type = $signatures[0]['parameters'][$key];
} else {
$type = null;
}

if (isset($signature['parameters'][$key])) {
$type = $signature['parameters'][$key];
$type = in_array($type, $validTypes) ? $type : Value::AUTO_DETECT_TYPE;
}
if (empty($type) || !in_array($type, $validTypes)) {
$type = Value::AUTO_DETECT_TYPE;
}

$params[$key] = Value::getXmlRpcValue($param, $type);
Expand Down
6 changes: 4 additions & 2 deletions src/Client/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace Zend\XmlRpc\Client\Exception;

use Zend\XmlRpc\Exception\ExceptionInterface as Exception;

/**
* Base class for all Zend_XmlRpc_Client_* exceptions
*
Expand All @@ -30,5 +32,5 @@
* @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 \Zend\XmlRpc\Exception\ExceptionInterface
{}
interface ExceptionInterface extends Exception
{}
8 changes: 5 additions & 3 deletions src/Client/Exception/FaultException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace Zend\XmlRpc\Client\Exception;

use Zend\XmlRpc\Exception;

/**
* Thrown by Zend_XmlRpc_Client when an XML-RPC fault response is returned.
*
Expand All @@ -31,6 +33,6 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class FaultException
extends \BadMethodCallException
implements \Zend\XmlRpc\Client\Exception\ExceptionInterface
{}
extends Exception\BadMethodCallException
implements ExceptionInterface
{}
5 changes: 2 additions & 3 deletions src/Client/Exception/IntrospectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class IntrospectException
extends \InvalidArgumentException
implements \Zend\XmlRpc\Client\Exception\ExceptionInterface
{}
extends InvalidArgumentException
{}
8 changes: 5 additions & 3 deletions src/Client/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Zend\XmlRpc\Client\Exception;

use Zend\XmlRpc\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\XmlRpc\Exception\ExceptionInterface
{}
extends Exception\InvalidArgumentException
implements ExceptionInterface
{}
9 changes: 5 additions & 4 deletions src/Client/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace Zend\XmlRpc\Client\Exception;

use Zend\XmlRpc\Exception;

class RuntimeException
extends \RuntimeException
implements \Zend\XmlRpc\Client\Exception\ExceptionInterface
{}

extends Exception\RuntimeException
implements ExceptionInterface
{}
8 changes: 8 additions & 0 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Zend\XmlRpc\Exception;

class BadMethodCallException
extends \BadMethodCallException
implements ExceptionInterface
{}
3 changes: 1 addition & 2 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\XmlRpc\Exception\ExceptionInterface
implements ExceptionInterface
{}

3 changes: 1 addition & 2 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

class RuntimeException
extends \RuntimeException
implements \Zend\XmlRpc\Exception\ExceptionInterface
implements ExceptionInterface
{}

5 changes: 2 additions & 3 deletions src/Exception/ValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@
*/
class ValueException
extends \LogicException
implements \Zend\XmlRpc\Exception\ExceptionInterface
{}

implements ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Request/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Request/Stdin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Response/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Server extends AbstractServer
'i4' => 'i4',
'int' => 'int',
'integer' => 'int',
'Zend\Crypt\Math\BigInteger' => 'i8',
'Zend\Math\BigInteger' => 'i8',
'i8' => 'i8',
'ex:i8' => 'i8',
'double' => 'double',
Expand Down
8 changes: 5 additions & 3 deletions src/Server/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Zend\XmlRpc\Server\Exception;

use Zend\XmlRpc\Exception;

class BadMethodCallException
extends \BadMethodCallException
implements \Zend\XmlRpc\Server\Exception\ExceptionInterface
{}
extends Exception\BadMethodCallException
implements ExceptionInterface
{}
8 changes: 4 additions & 4 deletions src/Server/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace Zend\XmlRpc\Server\Exception;

use Zend\XmlRpc\Exception\ExceptionInterface as Exception;

/**
* Zend_XmlRpc_Server_Exception
*
Expand All @@ -30,7 +32,5 @@
* @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 \Zend\XmlRpc\Exception\ExceptionInterface
{
}

interface ExceptionInterface extends Exception
{}
8 changes: 5 additions & 3 deletions src/Server/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Zend\XmlRpc\Server\Exception;

use Zend\XmlRpc\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\XmlRpc\Server\Exception\ExceptionInterface
{}
extends Exception\InvalidArgumentException
implements ExceptionInterface
{}
8 changes: 5 additions & 3 deletions src/Server/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Zend\XmlRpc\Server\Exception;

use Zend\XmlRpc\Exception;

class RuntimeException
extends \RuntimeException
implements \Zend\XmlRpc\Server\Exception\ExceptionInterface
{}
extends Exception\RuntimeException
implements ExceptionInterface
{}
Loading

0 comments on commit ef273f8

Please sign in to comment.