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 ZF2-377
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-mabe committed Jul 17, 2012
5 parents 5ef6a39 + 65e3b0b + 459f1f9 + e0c8424 + 58fd018 commit 845333c
Show file tree
Hide file tree
Showing 26 changed files with 1,026 additions and 184 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
8 changes: 5 additions & 3 deletions src/Client/Adapter/Curl.php
Expand Up @@ -357,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 @@ -389,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
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);
}

0 comments on commit 845333c

Please sign in to comment.