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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Preparing to tag 2.1.0 -- all new features from develop are now merged to master.
  • Loading branch information
Show file tree
Hide file tree
Showing 45 changed files with 37 additions and 197 deletions.
3 changes: 0 additions & 3 deletions src/AbstractValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -22,8 +21,6 @@
*
* Using this function, users/Zend\XmlRpc\Client object can create the Zend\XmlRpc\Value objects
* from PHP variables, XML string or by specifying the exact XML-RPC natvie type
*
* @package Zend_XmlRpc
*/
abstract class AbstractValue
{
Expand Down
5 changes: 0 additions & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -16,10 +15,6 @@

/**
* An XML-RPC client implementation
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class Client implements ServerClient
{
Expand Down
5 changes: 0 additions & 5 deletions src/Client/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -14,10 +13,6 @@

/**
* Base class for all Zend_XmlRpc_Client_* exceptions
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
interface ExceptionInterface extends Exception
{
Expand Down
5 changes: 0 additions & 5 deletions src/Client/Exception/FaultException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -14,10 +13,6 @@

/**
* Thrown by Zend_XmlRpc_Client when an XML-RPC fault response is returned.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class FaultException extends Exception\BadMethodCallException implements ExceptionInterface
{
Expand Down
5 changes: 0 additions & 5 deletions src/Client/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;

/**
* Thrown by Zend_XmlRpc_Client when an HTTP error occurs during an
* XML-RPC method call.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class HttpException extends RuntimeException
{
Expand Down
5 changes: 0 additions & 5 deletions src/Client/Exception/IntrospectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;

/**
* Thrown by Zend_XmlRpc_Client_Introspection when any error occurs.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class IntrospectException extends InvalidArgumentException
{
Expand Down
1 change: 0 additions & 1 deletion src/Client/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand Down
1 change: 0 additions & 1 deletion src/Client/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand Down
7 changes: 1 addition & 6 deletions src/Client/ServerIntrospection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -14,10 +13,6 @@

/**
* Wraps the XML-RPC system.* introspection methods
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class ServerIntrospection
{
Expand Down Expand Up @@ -48,7 +43,7 @@ public function getSignatureForEachMethod()

try {
$signatures = $this->getSignatureForEachMethodByMulticall($methods);
} catch (FaultException $e) {
} catch (Exception\FaultException $e) {
// degrade to looping
}

Expand Down
5 changes: 0 additions & 5 deletions src/Client/ServerProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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;
Expand All @@ -16,10 +15,6 @@
* The namespace decorator enables object chaining to permit
* calling XML-RPC namespaced functions like "foo.bar.baz()"
* as "$remote->foo->bar->baz()".
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
*/
class ServerProxy
{
Expand Down
1 change: 0 additions & 1 deletion src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Exception;
Expand Down
5 changes: 0 additions & 5 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Exception;

/**
* @category Zend
* @package Zend_XmlRpc
*/
interface ExceptionInterface
{
}
1 change: 0 additions & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Exception;
Expand Down
1 change: 0 additions & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Exception;
Expand Down
6 changes: 0 additions & 6 deletions src/Exception/ValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Exception;

/**
* @category Zend
* @package Zend_XmlRpc
* @subpackage Value
*/
class ValueException extends \LogicException implements ExceptionInterface
{
}
23 changes: 17 additions & 6 deletions src/Fault.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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 SimpleXMLElement;

/**
* XMLRPC Faults
*
Expand All @@ -19,9 +20,6 @@
*
* To allow method chaining, you may only use the {@link getInstance()} factory
* to instantiate a Zend_XmlRpc_Server_Fault.
*
* @category Zend
* @package Zend_XmlRpc
*/
class Fault
{
Expand Down Expand Up @@ -171,7 +169,7 @@ public function getEncoding()
* @param string $fault
* @return bool Returns true if successfully loaded fault response, false
* if response was not a fault response
* @throws \Zend\XmlRpc\Exception\ExceptionInterface if no or faulty XML provided, or if fault
* @throws Exception\ExceptionInterface if no or faulty XML provided, or if fault
* response does not contain either code or message
*/
public function loadXml($fault)
Expand All @@ -180,12 +178,25 @@ public function loadXml($fault)
throw new Exception\InvalidArgumentException('Invalid XML provided to fault');
}

$xmlErrorsFlag = libxml_use_internal_errors(true);
try {
$xml = new \SimpleXMLElement($fault);
$xml = new SimpleXMLElement($fault);
} catch (\Exception $e) {
// Not valid XML
throw new Exception\InvalidArgumentException('Failed to parse XML fault: ' . $e->getMessage(), 500, $e);
}
if (!$xml instanceof SimpleXMLElement) {
$errors = libxml_get_errors();
$errors = array_reduce($errors, function ($result, $item) {
if (empty($result)) {
return $item->message;
}
return $result . '; ' . $item->message;
}, '');
libxml_use_internal_errors($xmlErrorsFlag);
throw new Exception\InvalidArgumentException('Failed to parse XML fault: ' . $errors, 500);
}
libxml_use_internal_errors($xmlErrorsFlag);

// Check for fault
if (!$xml->fault) {
Expand Down
2 changes: 0 additions & 2 deletions src/Generator/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Generator;

/**
* Abstract XML generator adapter
*
*/
abstract class AbstractGenerator implements GeneratorInterface
{
Expand Down
5 changes: 0 additions & 5 deletions src/Generator/DomDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Generator;

/**
* DOMDocument based implementation of a XML/RPC generator
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Generator
*/
class DomDocument extends AbstractGenerator
{
Expand Down
1 change: 0 additions & 1 deletion src/Generator/GeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Generator;
Expand Down
5 changes: 0 additions & 5 deletions src/Generator/XmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 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\Generator;

/**
* XML generator adapter based on XMLWriter
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Generator
*/
class XmlWriter extends AbstractGenerator
{
Expand Down
Loading

0 comments on commit 6e89cc1

Please sign in to comment.