Skip to content

Commit 94df966

Browse files
Merge pull request #104 from basho/pb_support
Move all HTTP specific code to Api\Http layer in preparation for PB Support
2 parents af51209 + 81b0b4b commit 94df966

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+919
-757
lines changed

src/Riak/Api.php

+29-52
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,9 @@ abstract class Api
3232
protected $request = '';
3333

3434
/**
35-
* Request body to be sent
36-
*
37-
* @var string
38-
*/
39-
protected $requestBody = '';
40-
41-
/**
42-
* Response headers returned from request
43-
*
44-
* @var array
45-
*/
46-
protected $responseHeaders = [];
47-
48-
/**
49-
* Response body returned from request
50-
*
51-
* @var string
52-
*/
53-
protected $responseBody = '';
54-
55-
/**
56-
* HTTP Status Code from response
57-
*
58-
* @var int
35+
* @var Command\Response|null
5936
*/
60-
protected $statusCode = 0;
37+
protected $response = null;
6138

6239
/**
6340
* @var Command|null
@@ -88,14 +65,6 @@ public function getError()
8865
return $this->error;
8966
}
9067

91-
/**
92-
* @return int
93-
*/
94-
public function getStatusCode()
95-
{
96-
return $this->statusCode;
97-
}
98-
9968
/**
10069
* @return Command|null
10170
*/
@@ -141,23 +110,7 @@ public function setNode($node)
141110
*/
142111
public function getRequest()
143112
{
144-
return $this->request . $this->requestBody;
145-
}
146-
147-
/**
148-
* @return string
149-
*/
150-
public function getResponseBody()
151-
{
152-
return $this->responseBody;
153-
}
154-
155-
/**
156-
* @return array
157-
*/
158-
public function getResponseHeaders()
159-
{
160-
return $this->responseHeaders;
113+
return $this->request;
161114
}
162115

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

132+
/**
133+
* @return Command\Response|null
134+
*/
135+
public function getResponse()
136+
{
137+
return $this->response;
138+
}
139+
140+
/**
141+
* @return null
142+
*/
143+
public function getSuccess()
144+
{
145+
return $this->success;
146+
}
147+
148+
/**
149+
* @return array
150+
*/
151+
public function getConfig()
152+
{
153+
return $this->config;
154+
}
155+
179156
/**
180157
* send
181158
*
182-
* @return Command\Response
159+
* @return bool
183160
*/
184161
abstract public function send();
185-
}
162+
}

0 commit comments

Comments
 (0)