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

Commit

Permalink
HTTP -> Http
Browse files Browse the repository at this point in the history
- Found all instances of HTTP, in directory and filenames as well as namespace
  and classnames, and converted to Http
  • Loading branch information
weierophinney committed Jul 20, 2010
1 parent 2175af2 commit fee9cac
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 44 deletions.
28 changes: 14 additions & 14 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,7 +56,7 @@ class Client

/**
* HTTP Client to use for requests
* @var Zend\HTTP\Client
* @var Zend\Http\Client
*/
protected $_httpClient = null;

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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()
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{}
2 changes: 1 addition & 1 deletion src/Request/HTTP.php → src/Request/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Response/HTTP.php → src/Response/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Value/BigInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,7 +37,7 @@
class BigInteger extends Integer
{
/**
* @var \Zend\Crypt\Math\BigInteger\BigInteger
* @var \Zend\Crypt\Math\BigInteger
*/
protected $_integer;

Expand All @@ -46,15 +46,15 @@ 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;
}

/**
* Return bigint value object
*
* @return \Zend\Crypt\Math\BigInteger\BigInteger
* @return \Zend\Crypt\Math\BigInteger
*/
public function getValue()
{
Expand Down
18 changes: 9 additions & 9 deletions test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand All @@ -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);
Expand Down Expand Up @@ -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');
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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()
Expand All @@ -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);
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/Request/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,7 +76,7 @@ public function setUp()
</params>
</methodCall>
EOX;
$this->request = new Request\HTTP();
$this->request = new Request\Http();
$this->request->loadXml($this->xml);

$this->server = $_SERVER;
Expand Down Expand Up @@ -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');
}
Expand All @@ -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);
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions test/ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("<value><i8>$bigInt</i8></value>",
Expand All @@ -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) {
Expand Down

0 comments on commit fee9cac

Please sign in to comment.