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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into feat…
Browse files Browse the repository at this point in the history
…ure/console
  • Loading branch information
Thinkscape committed Jul 15, 2012
2 parents 541ce68 + 459f1f9 commit 52fbeb6
Show file tree
Hide file tree
Showing 89 changed files with 1,203 additions and 368 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Expand Up @@ -123,7 +123,7 @@ class Client implements Stdlib\DispatchableInterface
*
* @var resource
*/
static protected $_fileInfoDb = null;
protected static $_fileInfoDb = null;

/**
* Constructor
Expand Down
13 changes: 10 additions & 3 deletions src/Client/Adapter/Curl.php
Expand Up @@ -300,6 +300,11 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo
}
break;

case 'PATCH' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlValue = "PATCH";
break;

case 'DELETE' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlValue = "DELETE";
Expand Down Expand Up @@ -352,9 +357,9 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo

// Treating basic auth headers in a special way
if (array_key_exists('Authorization', $headers) && 'Basic' == substr($headers['Authorization'], 0, 5)) {
curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($this->curl, CURLOPT_USERPWD, base64_decode(substr($headers['Authorization'], 6)));
unset($headers['Authorization']);
curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($this->curl, CURLOPT_USERPWD, base64_decode(substr($headers['Authorization'], 6)));
unset($headers['Authorization']);
}

// set additional headers
Expand Down Expand Up @@ -384,6 +389,8 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo
} elseif ($method == 'PUT') {
// This is a PUT by a setRawData string, not by file-handle
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
} elseif ($method == 'PATCH') {
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
}

// set additional curl options
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Adapter/Exception/InvalidArgumentException.php
Expand Up @@ -17,6 +17,6 @@
* @category Zend
* @package Zend_Application
*/
class InvalidArgumentException extends Exception\InvalidArgumentException implements
class InvalidArgumentException extends Exception\InvalidArgumentException implements
ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Client/Adapter/Exception/OutOfRangeException.php
Expand Up @@ -17,6 +17,6 @@
* @category Zend
* @package Zend_Application
*/
class OutOfRangeException extends Exception\OutOfRangeException implements
class OutOfRangeException extends Exception\OutOfRangeException implements
ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Client/Adapter/Exception/RuntimeException.php
Expand Up @@ -17,6 +17,6 @@
* @category Zend
* @package Zend_Application
*/
class RuntimeException extends Exception\RuntimeException implements
class RuntimeException extends Exception\RuntimeException implements
ExceptionInterface
{}
14 changes: 7 additions & 7 deletions src/Client/Adapter/Socket.php
Expand Up @@ -292,7 +292,7 @@ public function read()
$response = '';
$gotStatus = false;

while (($line = @fgets($this->socket)) !== false) {
while (($line = fgets($this->socket)) !== false) {
$gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
if ($gotStatus) {
$response .= $line;
Expand Down Expand Up @@ -335,7 +335,7 @@ public function read()
if (strtolower($transfer_encoding->getFieldValue()) == 'chunked') {

do {
$line = @fgets($this->socket);
$line = fgets($this->socket);
$this->_checkSocketReadTimeout();

$chunk = $line;
Expand Down Expand Up @@ -364,7 +364,7 @@ public function read()
break;
}
} else {
$line = @fread($this->socket, $read_to - $current_pos);
$line = fread($this->socket, $read_to - $current_pos);
if ($line === false || strlen($line) === 0) {
$this->_checkSocketReadTimeout();
break;
Expand Down Expand Up @@ -409,12 +409,12 @@ public function read()
$current_pos = ftell($this->socket)) {

if ($this->out_stream) {
if (@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
if (stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
$this->_checkSocketReadTimeout();
break;
}
} else {
$chunk = @fread($this->socket, $read_to - $current_pos);
$chunk = fread($this->socket, $read_to - $current_pos);
if ($chunk === false || strlen($chunk) === 0) {
$this->_checkSocketReadTimeout();
break;
Expand All @@ -432,12 +432,12 @@ public function read()

do {
if ($this->out_stream) {
if (@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
if (stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
$this->_checkSocketReadTimeout();
break;
}
} else {
$buff = @fread($this->socket, 8192);
$buff = fread($this->socket, 8192);
if ($buff === false || strlen($buff) === 0) {
$this->_checkSocketReadTimeout();
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Adapter/StreamInterface.php
Expand Up @@ -29,5 +29,5 @@ interface StreamInterface
* @param resource $stream Stream to write the output to
*
*/
function setOutputStream($stream);
public function setOutputStream($stream);
}
3 changes: 2 additions & 1 deletion src/Client/Cookies.php
Expand Up @@ -248,7 +248,8 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
* @param int $ret_as What value to return
* @return array|string
*/
protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) {
protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT)
{
if (is_array($ptr)) {
$ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array());
foreach ($ptr as $item) {
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Exception/InvalidArgumentException.php
Expand Up @@ -17,6 +17,6 @@
* @category Zend
* @package Zend_Application
*/
class InvalidArgumentException extends Exception\InvalidArgumentException implements
class InvalidArgumentException extends Exception\InvalidArgumentException implements
ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Client/Exception/OutOfRangeException.php
Expand Up @@ -12,6 +12,6 @@

use Zend\Http\Exception;

class OutOfRangeException extends Exception\OutOfRangeException implements
class OutOfRangeException extends Exception\OutOfRangeException implements
ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Client/Exception/RuntimeException.php
Expand Up @@ -17,6 +17,6 @@
* @category Zend
* @package Zend_Application
*/
class RuntimeException extends Exception\RuntimeException implements
class RuntimeException extends Exception\RuntimeException implements
ExceptionInterface
{}
3 changes: 2 additions & 1 deletion src/Cookies.php
Expand Up @@ -220,7 +220,8 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
* @param int $ret_as What value to return
* @return array|string
*/
protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) {
protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT)
{
if (is_array($ptr)) {
$ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array());
foreach ($ptr as $item) {
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Expand Up @@ -10,7 +10,7 @@

namespace Zend\Http\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Exception/OutOfRangeException.php
Expand Up @@ -10,6 +10,6 @@

namespace Zend\Http\Exception;

class OutOfRangeException extends \OutOfRangeException implements
class OutOfRangeException extends \OutOfRangeException implements
ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Exception/RuntimeException.php
Expand Up @@ -10,7 +10,7 @@

namespace Zend\Http\Exception;

class RuntimeException extends \RuntimeException implements
class RuntimeException extends \RuntimeException implements
ExceptionInterface
{
}

0 comments on commit 52fbeb6

Please sign in to comment.