diff --git a/src/Client.php b/src/Client.php index f927d87..03ab5d6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -24,15 +24,15 @@ * @namespace */ namespace Zend\XmlRpc; -use Zend\HTTP, +use Zend\Http, Zend\XmlRpc\Value; /** * An XML-RPC client implementation * - * @uses Zend\HTTP\Client + * @uses Zend\Http\Client * @uses Zend\XmlRpc\Client\FaultException - * @uses Zend\XmlRpc\Client\HTTPException + * @uses Zend\XmlRpc\Client\HttpException * @uses Zend\XmlRpc\Client\ServerIntrospection * @uses Zend\XmlRpc\Client\ServerProxy * @uses Zend\XmlRpc\Fault @@ -56,7 +56,7 @@ class Client /** * HTTP Client to use for requests - * @var Zend\HTTP\Client + * @var Zend\Http\Client */ protected $_httpClient = null; @@ -95,13 +95,13 @@ class Client * * @param string $server Full address of the XML-RPC service * (e.g. http://time.xmlrpc.com/RPC2) - * @param Zend\HTTP\Client $httpClient HTTP Client to use for requests + * @param Zend\Http\Client $httpClient HTTP Client to use for requests * @return void */ - public function __construct($server, HTTP\Client $httpClient = null) + public function __construct($server, Http\Client $httpClient = null) { if ($httpClient === null) { - $this->_httpClient = new HTTP\Client(); + $this->_httpClient = new Http\Client(); } else { $this->_httpClient = $httpClient; } @@ -114,10 +114,10 @@ public function __construct($server, HTTP\Client $httpClient = null) /** * Sets the HTTP client object to use for connecting the XML-RPC server. * - * @param Zend\HTTP\Client $httpClient - * @return Zend\HTTP\Client + * @param Zend\Http\Client $httpClient + * @return Zend\Http\Client */ - public function setHttpClient(HTTP\Client $httpClient) + public function setHttpClient(Http\Client $httpClient) { return $this->_httpClient = $httpClient; } @@ -126,7 +126,7 @@ public function setHttpClient(HTTP\Client $httpClient) /** * Gets the HTTP client object. * - * @return Zend\HTTP\Client + * @return Zend\Http\Client */ public function getHttpClient() { @@ -222,7 +222,7 @@ public function skipSystemLookup() * @param Zend\XmlRpc\Request $request * @param null|Zend\XmlRpc\Response $response * @return void - * @throws Zend\XmlRpc\Client\HTTPException + * @throws Zend\XmlRpc\Client\HttpException */ public function doRequest($request, $response = null) { @@ -248,13 +248,13 @@ public function doRequest($request, $response = null) $xml = $this->_lastRequest->__toString(); $http->setRawData($xml); - $httpResponse = $http->request(HTTP\Client::POST); + $httpResponse = $http->request(Http\Client::POST); if (! $httpResponse->isSuccessful()) { /** * Exception thrown when an HTTP error occurs */ - throw new Client\HTTPException( + throw new Client\HttpException( $httpResponse->getMessage(), $httpResponse->getStatus() ); diff --git a/src/Client/HTTPException.php b/src/Client/HttpException.php similarity index 96% rename from src/Client/HTTPException.php rename to src/Client/HttpException.php index c9af5e5..17419db 100644 --- a/src/Client/HTTPException.php +++ b/src/Client/HttpException.php @@ -36,5 +36,5 @@ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class HTTPException extends Exception +class HttpException extends Exception {} diff --git a/src/Request/HTTP.php b/src/Request/Http.php similarity index 98% rename from src/Request/HTTP.php rename to src/Request/Http.php index b889831..f9060a3 100644 --- a/src/Request/HTTP.php +++ b/src/Request/Http.php @@ -41,7 +41,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ -class HTTP extends XmlRpcRequest +class Http extends XmlRpcRequest { /** * Array of headers diff --git a/src/Response/HTTP.php b/src/Response/Http.php similarity index 97% rename from src/Response/HTTP.php rename to src/Response/Http.php index 91d4ff8..5651372 100644 --- a/src/Response/HTTP.php +++ b/src/Response/Http.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ -class HTTP extends XmlRpcResponse +class Http extends XmlRpcResponse { /** * Override __toString() to send HTTP Content-Type header diff --git a/src/Server.php b/src/Server.php index 46bd25d..aa6c229 100644 --- a/src/Server.php +++ b/src/Server.php @@ -66,9 +66,9 @@ * @uses Zend\Server\Reflection\AbstractFunction * @uses Zend\Server\Reflection\ReflectionMethod * @uses Zend\XmlRpc\Request - * @uses Zend\XmlRpc\Request\HTTP + * @uses Zend\XmlRpc\Request\Http * @uses Zend\XmlRpc\Response - * @uses Zend\XmlRpc\Response\HTTP + * @uses Zend\XmlRpc\Response\Http * @uses Zend\XmlRpc\Server\Exception * @uses Zend\XmlRpc\Server\Fault * @uses Zend\XmlRpc\Server\System @@ -94,10 +94,10 @@ class Server extends AbstractServer protected $_request = null; /** - * Class to use for responses; defaults to {@link Zend\XmlRpc\Response\HTTP} + * Class to use for responses; defaults to {@link Zend\XmlRpc\Response\Http} * @var string */ - protected $_responseClass = 'Zend\\XmlRpc\\Response\\HTTP'; + protected $_responseClass = 'Zend\\XmlRpc\\Response\\Http'; /** * Dispatch table of name => method pairs @@ -283,7 +283,7 @@ public function handle($request = false) if ((!$request || !$request instanceof Request) && (null === ($request = $this->getRequest())) ) { - $request = new Request\HTTP(); + $request = new Request\Http(); $request->setEncoding($this->getEncoding()); } diff --git a/src/Value.php b/src/Value.php index 337d8ef..de08a58 100644 --- a/src/Value.php +++ b/src/Value.php @@ -275,7 +275,7 @@ protected static function _phpVarToNativeXmlRpc($value) return $value; } - if ($value instanceof \Zend\Crypt\Math\BigInteger\BigInteger) { + if ($value instanceof \Zend\Crypt\Math\BigInteger) { return new Value\BigInteger($value); } diff --git a/src/Value/BigInteger.php b/src/Value/BigInteger.php index 58a59e1..0fab793 100644 --- a/src/Value/BigInteger.php +++ b/src/Value/BigInteger.php @@ -26,7 +26,7 @@ namespace Zend\XmlRpc\Value; /** - * @uses \Zend\Crypt\Math\BigInteger\BigInteger + * @uses \Zend\Crypt\Math\BigInteger * @uses \Zend\XmlRpc\Value\Integer * @category Zend * @package Zend_XmlRpc @@ -37,7 +37,7 @@ class BigInteger extends Integer { /** - * @var \Zend\Crypt\Math\BigInteger\BigInteger + * @var \Zend\Crypt\Math\BigInteger */ protected $_integer; @@ -46,7 +46,7 @@ class BigInteger extends Integer */ public function __construct($value) { - $this->_integer = new \Zend\Crypt\Math\BigInteger\BigInteger(); + $this->_integer = new \Zend\Crypt\Math\BigInteger(); $this->_value = $this->_integer->init($this->_value); $this->_type = self::XMLRPC_TYPE_I8; } @@ -54,7 +54,7 @@ public function __construct($value) /** * Return bigint value object * - * @return \Zend\Crypt\Math\BigInteger\BigInteger + * @return \Zend\Crypt\Math\BigInteger */ public function getValue() { diff --git a/test/ClientTest.php b/test/ClientTest.php index aa00353..ee04f19 100644 --- a/test/ClientTest.php +++ b/test/ClientTest.php @@ -25,8 +25,8 @@ */ namespace ZendTest\XmlRpc; -use Zend\HTTP\Client\Adapter, - Zend\HTTP, +use Zend\Http\Client\Adapter, + Zend\Http, Zend\XmlRpc\Client, Zend\XmlRpc\Value, Zend\XmlRpc; @@ -61,7 +61,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->httpAdapter = new Adapter\Test(); - $this->httpClient = new HTTP\Client('http://foo', + $this->httpClient = new Http\Client('http://foo', array('adapter' => $this->httpAdapter)); $this->xmlrpcClient = new Client('http://foo'); @@ -74,14 +74,14 @@ public function testGettingDefaultHttpClient() { $xmlrpcClient = new Client('http://foo'); $httpClient = $xmlrpcClient->getHttpClient(); - $this->assertType('Zend\\HTTP\\Client', $httpClient); + $this->assertType('Zend\\Http\\Client', $httpClient); $this->assertSame($httpClient, $xmlrpcClient->getHttpClient()); } public function testSettingAndGettingHttpClient() { $xmlrpcClient = new Client('http://foo'); - $httpClient = new HTTP\Client('http://foo'); + $httpClient = new Http\Client('http://foo'); $this->assertNotSame($httpClient, $xmlrpcClient->getHttpClient()); $xmlrpcClient->setHttpClient($httpClient); @@ -316,7 +316,7 @@ public function testRpcMethodCallThrowsOnHttpFailure() $response = $this->makeHttpResponseFrom($body, $status, $message); $this->httpAdapter->setResponse($response); - $this->setExpectedException('Zend\\XmlRpc\\Client\\HTTPException', $message, $status); + $this->setExpectedException('Zend\\XmlRpc\\Client\\HttpException', $message, $status); $this->xmlrpcClient->call('foo'); } @@ -617,7 +617,7 @@ public function testSettingNoHttpClientUriForcesClientToSetUri() { $baseUri = "http://foo:80"; $this->httpAdapter = new Adapter\Test(); - $this->httpClient = new HTTP\Client(null, array('adapter' => $this->httpAdapter)); + $this->httpClient = new Http\Client(null, array('adapter' => $this->httpAdapter)); $this->xmlrpcClient = new Client($baseUri); $this->xmlrpcClient->setHttpClient($this->httpClient); @@ -706,7 +706,7 @@ public function makeHttpResponseFrom($data, $status=200, $message='OK') public function makeHttpResponseFor($nativeVars) { $response = $this->getServerResponseFor($nativeVars); - return \Zend\HTTP\Response::fromString($response); + return \Zend\Http\Response::fromString($response); } public function mockIntrospector() @@ -724,7 +724,7 @@ public function mockIntrospector() public function mockHttpClient() { - $this->mockedHttpClient = $this->getMock('Zend\\HTTP\\Client'); + $this->mockedHttpClient = $this->getMock('Zend\\Http\\Client'); $this->xmlrpcClient->setHttpClient($this->mockedHttpClient); } } diff --git a/test/Request/HttpTest.php b/test/Request/HttpTest.php index fbf1050..187761d 100644 --- a/test/Request/HttpTest.php +++ b/test/Request/HttpTest.php @@ -29,7 +29,7 @@ ZendTest\AllTests\StreamWrapper\PHPInput; /** - * Test case for Zend\XmlRpc\Request\HTTP + * Test case for Zend\XmlRpc\Request\Http * * @category Zend * @package Zend_XmlRpc @@ -76,7 +76,7 @@ public function setUp() EOX; - $this->request = new Request\HTTP(); + $this->request = new Request\Http(); $this->request->loadXml($this->xml); $this->server = $_SERVER; @@ -135,7 +135,7 @@ public function testGetFullRequest() public function testCanPassInMethodAndParams() { try { - $request = new Request\HTTP('foo', array('bar', 'baz')); + $request = new Request\Http('foo', array('bar', 'baz')); } catch (\Exception $e) { $this->fail('Should be able to pass in methods and params to request'); } @@ -155,7 +155,7 @@ public function testExtendingClassShouldBeAbleToReceiveMethodAndParams() public function testHttpRequestReadsFromPhpInput() { $this->assertNull(PHPInput::argumentsPassedTo('stream_open')); - $request = new Request\HTTP(); + $request = new Request\Http(); list($path, $mode,) = PHPInput::argumentsPassedTo('stream_open'); $this->assertSame('php://input', $path); $this->assertSame('rb', $mode); @@ -165,13 +165,13 @@ public function testHttpRequestReadsFromPhpInput() public function testHttpRequestGeneratesFaultIfReadFromPhpInputFails() { PHPInput::methodWillReturn('stream_open', false); - $request = new Request\HTTP(); + $request = new Request\Http(); $this->assertTrue($request->isFault()); $this->assertSame(630, $request->getFault()->getCode()); } } -class HTTPTestExtension extends Request\HTTP +class HTTPTestExtension extends Request\Http { public function __construct($method = null, $params = null) { diff --git a/test/ValueTest.php b/test/ValueTest.php index ed97d29..67df34e 100644 --- a/test/ValueTest.php +++ b/test/ValueTest.php @@ -148,7 +148,7 @@ public function testMarshalBigIntegerFromFromXmlRpc(Generator $generator) { Value::setGenerator($generator); $bigInt = (string)(PHP_INT_MAX + 1); - $native = new BigInteger\BigInteger(); + $native = new BigInteger(); $native->init($bigInt); $xmlStrings = array("$bigInt", @@ -171,7 +171,7 @@ public function testMarshalBigIntegerFromNative() $types = array(Value::XMLRPC_TYPE_APACHEI8, Value::XMLRPC_TYPE_I8); - $bigInt = new BigInteger\BigInteger(); + $bigInt = new BigInteger(); $bigInt->init($native); foreach ($types as $type) {