Skip to content

Commit

Permalink
Merge pull request #104 from basho/pb_support
Browse files Browse the repository at this point in the history
Move all HTTP specific code to Api\Http layer in preparation for PB Support
  • Loading branch information
christophermancini committed Sep 24, 2015
2 parents af51209 + 81b0b4b commit 94df966
Show file tree
Hide file tree
Showing 65 changed files with 919 additions and 757 deletions.
81 changes: 29 additions & 52 deletions src/Riak/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,9 @@ abstract class Api
protected $request = '';

/**
* Request body to be sent
*
* @var string
*/
protected $requestBody = '';

/**
* Response headers returned from request
*
* @var array
*/
protected $responseHeaders = [];

/**
* Response body returned from request
*
* @var string
*/
protected $responseBody = '';

/**
* HTTP Status Code from response
*
* @var int
* @var Command\Response|null
*/
protected $statusCode = 0;
protected $response = null;

/**
* @var Command|null
Expand Down Expand Up @@ -88,14 +65,6 @@ public function getError()
return $this->error;
}

/**
* @return int
*/
public function getStatusCode()
{
return $this->statusCode;
}

/**
* @return Command|null
*/
Expand Down Expand Up @@ -141,23 +110,7 @@ public function setNode($node)
*/
public function getRequest()
{
return $this->request . $this->requestBody;
}

/**
* @return string
*/
public function getResponseBody()
{
return $this->responseBody;
}

/**
* @return array
*/
public function getResponseHeaders()
{
return $this->responseHeaders;
return $this->request;
}

/**
Expand All @@ -176,10 +129,34 @@ public function prepare(Command $command, Node $node)
return $this;
}

/**
* @return Command\Response|null
*/
public function getResponse()
{
return $this->response;
}

/**
* @return null
*/
public function getSuccess()
{
return $this->success;
}

/**
* @return array
*/
public function getConfig()
{
return $this->config;
}

/**
* send
*
* @return Command\Response
* @return bool
*/
abstract public function send();
}
}
Loading

0 comments on commit 94df966

Please sign in to comment.