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

Commit

Permalink
Merge branch 'master' into markup
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Markup/Parser/Textile.php
	library/Zend/Markup/Renderer/AbstractRenderer.php
	library/Zend/Markup/Renderer/Html.php
  • Loading branch information
kokx committed Oct 30, 2010
2 parents 456243f + 473bfa3 commit 9f45cc7
Show file tree
Hide file tree
Showing 41 changed files with 1,021 additions and 365 deletions.
19 changes: 9 additions & 10 deletions src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down Expand Up @@ -122,7 +121,7 @@ public function __construct($strategy = true, $uri=null, $wsdlClass=null)
public function setUri($uri)
{
if(!is_string($uri) && !($uri instanceof Uri\Uri)) {
throw new AutoDiscoverException(
throw new Exception\InvalidArgumentException(
'No uri given to \Zend\Soap\AutoDiscover::setUri as string or \Zend\Uri\Uri instance.'
);
}
Expand Down Expand Up @@ -165,7 +164,7 @@ public function getUri()
public function setWsdlClass($wsdlClass)
{
if(!is_string($wsdlClass) && !is_subclass_of($wsdlClass, 'Zend\Soap\Wsdl')) {
throw new AutoDiscoverException(
throw new Exception\InvalidArgumentException(
'No \Zend\Soap\Wsdl subclass given to Zend\Soap\AutoDiscover::setWsdlClass as string.'
);
}
Expand Down Expand Up @@ -196,7 +195,7 @@ public function getWsdlClass()
public function setOperationBodyStyle(array $operationStyle=array())
{
if(!isset($operationStyle['use'])) {
throw new AutoDiscoverException("Key 'use' is required in Operation soap:body style.");
throw new Exception\InvalidArgumentException("Key 'use' is required in Operation soap:body style.");
}
$this->_operationBodyStyle = $operationStyle;
return $this;
Expand Down Expand Up @@ -386,7 +385,7 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
}
}
if ($prototype === null) {
throw new AutoDiscoverException("No prototypes could be found for the '" . $function->getName() . "' function");
throw new Exception\InvalidArgumentException("No prototypes could be found for the '" . $function->getName() . "' function");
}

$functionName = Wsdl::translateType($function->getName());
Expand Down Expand Up @@ -482,7 +481,7 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
*/
public function fault($fault = null, $code = null)
{
throw new AutoDiscoverException('Function has no use in AutoDiscover.');
throw new Exception\UnexpectedValueException('Function has no use in AutoDiscover.');
}

/**
Expand All @@ -508,7 +507,7 @@ public function dump($filename)
if($this->_wsdl !== null) {
return $this->_wsdl->dump($filename);
} else {
throw new AutoDiscoverException('Cannot dump autodiscovered contents, WSDL file has not been generated yet.');
throw new Exception\RuntimeException('Cannot dump autodiscovered contents, WSDL file has not been generated yet.');
}
}

Expand All @@ -520,7 +519,7 @@ public function toXml()
if($this->_wsdl !== null) {
return $this->_wsdl->toXml();
} else {
throw new AutoDiscoverException('Cannot return autodiscovered contents, WSDL file has not been generated yet.');
throw new Exception\RuntimeException('Cannot return autodiscovered contents, WSDL file has not been generated yet.');
}
}

Expand All @@ -541,7 +540,7 @@ public function getFunctions()
*/
public function loadFunctions($definition)
{
throw new AutoDiscoverException('Function has no use in AutoDiscover.');
throw new Exception\RuntimeException('Function has no use in AutoDiscover.');
}

/**
Expand All @@ -551,7 +550,7 @@ public function loadFunctions($definition)
*/
public function setPersistence($mode)
{
throw new AutoDiscoverException('Function has no use in AutoDiscover.');
throw new Exception\RuntimeException('Function has no use in AutoDiscover.');
}

/**
Expand Down
31 changes: 15 additions & 16 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage Client
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down Expand Up @@ -143,7 +142,7 @@ class Client
public function __construct($wsdl = null, $options = null)
{
if (!extension_loaded('soap')) {
throw new ClientException('SOAP extension is not loaded.');
throw new Exception\ExtensionNotLoadedException('SOAP extension is not loaded.');
}

if ($wsdl !== null) {
Expand Down Expand Up @@ -269,7 +268,7 @@ public function setOptions($options)
// break;

default:
throw new ClientException('Unknown SOAP client option');
throw new Exception\InvalidArgumentException('Unknown SOAP client option');
break;
}
}
Expand Down Expand Up @@ -338,7 +337,7 @@ public function getOptions()
public function setSoapVersion($version)
{
if (!in_array($version, array(SOAP_1_1, SOAP_1_2))) {
throw new ClientException('Invalid soap version specified. Use SOAP_1_1 or SOAP_1_2 constants.');
throw new Exception\InvalidArgumentException('Invalid soap version specified. Use SOAP_1_1 or SOAP_1_2 constants.');
}
$this->_soapVersion = $version;

Expand Down Expand Up @@ -368,7 +367,7 @@ public function setClassmap(array $classmap)
{
foreach ($classmap as $type => $class) {
if (!class_exists($class)) {
throw new ClientException('Invalid class in class map');
throw new Exception\InvalidArgumentException('Invalid class in class map');
}
}

Expand Down Expand Up @@ -430,7 +429,7 @@ public function validateUrn($urn)
{
$scheme = parse_url($urn, PHP_URL_SCHEME);
if ($scheme === false || $scheme === null) {
throw new ClientException('Invalid URN');
throw new Exception\InvalidArgumentException('Invalid URN');
}

return true;
Expand Down Expand Up @@ -505,7 +504,7 @@ public function getLocation()
public function setStyle($style)
{
if (!in_array($style, array(SOAP_RPC, SOAP_DOCUMENT))) {
throw new ClientException('Invalid request style specified. Use SOAP_RPC or SOAP_DOCUMENT constants.');
throw new Exception\InvalidArgumentException('Invalid request style specified. Use SOAP_RPC or SOAP_DOCUMENT constants.');
}

$this->_style = $style;
Expand Down Expand Up @@ -535,7 +534,7 @@ public function getStyle()
public function setEncodingMethod($use)
{
if (!in_array($use, array(SOAP_ENCODED, SOAP_LITERAL))) {
throw new ClientException('Invalid message encoding method. Use SOAP_ENCODED or SOAP_LITERAL constants.');
throw new Exception\InvalidArgumentException('Invalid message encoding method. Use SOAP_ENCODED or SOAP_LITERAL constants.');
}

$this->_use = $use;
Expand Down Expand Up @@ -705,7 +704,7 @@ public function setProxyPassword($proxyPassword)
public function setHttpsCertificate($localCert)
{
if (!is_readable($localCert)) {
throw new ClientException('Invalid HTTPS client certificate path.');
throw new Exception\InvalidArgumentException('Invalid HTTPS client certificate path.');
}

$this->_local_cert = $localCert;
Expand Down Expand Up @@ -793,7 +792,7 @@ public function getProxyPassword()
public function setStreamContext($context)
{
if(!is_resource($context) || get_resource_type($context) !== "stream-context") {
throw new ClientException('Invalid stream context resource given.');
throw new Exception\InvalidArgumentException('Invalid stream context resource given.');
}

$this->_stream_context = $context;
Expand Down Expand Up @@ -981,17 +980,17 @@ protected function _initSoapClientObject()

if ($wsdl == null) {
if (!isset($options['location'])) {
throw new ClientException('\'location\' parameter is required in non-WSDL mode.');
throw new Exception\UnexpectedValueException('\'location\' parameter is required in non-WSDL mode.');
}
if (!isset($options['uri'])) {
throw new ClientException('\'uri\' parameter is required in non-WSDL mode.');
throw new Exception\UnexpectedValueException('\'uri\' parameter is required in non-WSDL mode.');
}
} else {
if (isset($options['use'])) {
throw new ClientException('\'use\' parameter only works in non-WSDL mode.');
throw new Exception\UnexpectedValueException('\'use\' parameter only works in non-WSDL mode.');
}
if (isset($options['style'])) {
throw new ClientException('\'style\' parameter only works in non-WSDL mode.');
throw new Exception\UnexpectedValueException('\'style\' parameter only works in non-WSDL mode.');
}
}
unset($options['wsdl']);
Expand Down Expand Up @@ -1103,7 +1102,7 @@ public function __call($name, $arguments)
public function getFunctions()
{
if ($this->getWSDL() == null) {
throw new ClientException('\'getFunctions\' method is available only in WSDL mode.');
throw new Exception\UnexpectedValueException(__METHOD__ . ' is available only in WSDL mode.');
}

$soapClient = $this->getSoapClient();
Expand All @@ -1126,7 +1125,7 @@ public function getFunctions()
public function getTypes()
{
if ($this->getWSDL() == null) {
throw new ClientException('\'getTypes\' method is available only in WSDL mode.');
throw new Exception\UnexpectedValueException(__METHOD__ . ' method is available only in WSDL mode.');
}

$soapClient = $this->getSoapClient();
Expand Down
1 change: 0 additions & 1 deletion src/Client/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage Client
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
5 changes: 2 additions & 3 deletions src/Client/DotNet.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage Client
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -26,7 +25,7 @@
namespace Zend\Soap\Client;

use Zend\Soap\Client as SOAPClient,
Zend\Soap\ClientException;
Zend\Soap\Exception;

/**
* .NET SOAP client
Expand Down Expand Up @@ -73,7 +72,7 @@ protected function _preProcessArguments($arguments)
if (count($arguments) > 1 ||
(count($arguments) == 1 && !is_array(reset($arguments)))
) {
throw new ClientException('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).');
throw new Exception\RuntimeException('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).');
}

// Do nothing
Expand Down
1 change: 0 additions & 1 deletion src/Client/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage Client
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
38 changes: 0 additions & 38 deletions src/ClientException.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -30,6 +29,6 @@
* @package Zend_Soap
* @subpackage AutoDiscover
*/
class Exception extends \Zend\Exception
interface Exception
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage AutoDiscover
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
9 changes: 9 additions & 0 deletions src/Exception/ExceptionNotLoadedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Zend\Soap\Exception;

class ExtensionNotLoadedException
extends \RuntimeException
implements \Zend\Soap\Exception
{
}
9 changes: 9 additions & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Zend\Soap\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\Soap\Exception
{
}
10 changes: 10 additions & 0 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Zend\Soap\Exception;

class RuntimeException
extends \RuntimeException
implements \Zend\Soap\Exception
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* @subpackage Server
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
class ServerException extends Exception
{}
Expand Down
10 changes: 10 additions & 0 deletions src/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Zend\Soap\Exception;

class UnexpectedValueException
extends \UnexpectedValueException
implements \Zend\Soap\Exception
{

}
1 change: 0 additions & 1 deletion src/WsdlException.php → src/Exception/WsdlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage WSDL
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
Loading

0 comments on commit 9f45cc7

Please sign in to comment.