Skip to content

Commit 313e9c5

Browse files
committed
No longer rawurlencoding things...
1 parent 570e691 commit 313e9c5

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

docs/AGENT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ object. Below is a quick and sloppy example that also creates a check:
6969
```php
7070
$service = new \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration(
7171
array(
72-
'Name' => 'dan test service',
72+
'Name' => 'service-name',
7373
'Check' => new \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck(
7474
array(
7575
'HTTP' => 'http://127.0.0.1:8000',
@@ -100,7 +100,7 @@ object. Below is a quick and sloppy example:
100100
```php
101101
$check = new \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration(
102102
array(
103-
'Name' => 'dan test service check',
103+
'Name' => 'service-check',
104104
'TCP' => '127.0.0.1:8000',
105105
'Interval' => '10s',
106106
'ServiceID' => 'dan test service'

docs/CATALOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $catalogRegistration = new \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration(
2323
'Address' => 'address of node',
2424
'Service' => new \DCarbone\PHPConsulAPI\Agent\AgentService(
2525
array(
26-
'Service' => 'dan-no-space-test',
26+
'Service' => 'service-name',
2727
)
2828
)
2929
)
@@ -47,7 +47,7 @@ $catalogDeregistration = new \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistratio
4747
array(
4848
'Node' => 'name of node',
4949
'Address' => 'address of node',
50-
'ServiceID' => 'dan-no-space-test'
50+
'ServiceID' => 'service-name'
5151
)
5252
);
5353

src/Agent/AgentClient.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function serviceRegister(AgentServiceRegistration $agentServiceRegistrati
185185
*/
186186
public function serviceDeregister($serviceID)
187187
{
188-
$r = new HttpRequest('put', sprintf('v1/agent/service/deregister/%s', rawurlencode($serviceID)), $this->_Config);
188+
$r = new HttpRequest('put', sprintf('v1/agent/service/deregister/%s', $serviceID), $this->_Config);
189189

190190
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
191191

@@ -238,7 +238,7 @@ public function failTTL($checkID, $note)
238238
*/
239239
public function updateTTL($checkID, $output, $status)
240240
{
241-
$r = new HttpRequest('put', sprintf('v1/agent/check/update/%s', rawurlencode($checkID)), $this->_Config);
241+
$r = new HttpRequest('put', sprintf('v1/agent/check/update/%s', $checkID), $this->_Config);
242242
$r->body = (new AgentCheckUpdate(['Output' => $output, 'Status' => $status]));
243243

244244
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
@@ -266,7 +266,7 @@ public function checkRegister(AgentCheckRegistration $agentCheckRegistration)
266266
*/
267267
public function checkDeregister($checkID)
268268
{
269-
$r = new HttpRequest('put', sprintf('v1/agent/check/deregister/%s', rawurlencode($checkID)), $this->_Config);
269+
$r = new HttpRequest('put', sprintf('v1/agent/check/deregister/%s', $checkID), $this->_Config);
270270

271271
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
272272

@@ -280,7 +280,7 @@ public function checkDeregister($checkID)
280280
*/
281281
public function join($addr, $wan = false)
282282
{
283-
$r = new HttpRequest('put', sprintf('v1/agent/join/%s', rawurlencode($addr)), $this->_Config);
283+
$r = new HttpRequest('put', sprintf('v1/agent/join/%s', $addr), $this->_Config);
284284
if ($wan)
285285
$r->params->set('wan', 1);
286286

@@ -295,7 +295,7 @@ public function join($addr, $wan = false)
295295
*/
296296
public function forceLeave($node)
297297
{
298-
$r = new HttpRequest('put', sprintf('v1/agent/force-leave/%s', rawurlencode($node)), $this->_Config);
298+
$r = new HttpRequest('put', sprintf('v1/agent/force-leave/%s', $node), $this->_Config);
299299

300300
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
301301

@@ -309,7 +309,7 @@ public function forceLeave($node)
309309
*/
310310
public function enableServiceMaintenance($serviceID, $reason = '')
311311
{
312-
$r = new HttpRequest('put', sprintf('v1/agent/service/maintenance/%s', rawurlencode($serviceID)), $this->_Config);
312+
$r = new HttpRequest('put', sprintf('v1/agent/service/maintenance/%s', $serviceID), $this->_Config);
313313
$r->params->set('enable', 'true');
314314
$r->params->set('reason', $reason);
315315

@@ -324,7 +324,7 @@ public function enableServiceMaintenance($serviceID, $reason = '')
324324
*/
325325
public function disableServiceMaintenance($serviceID)
326326
{
327-
$r = new HttpRequest('put', sprintf('v1/agent/service/maintenance/%s', rawurlencode($serviceID)), $this->_Config);
327+
$r = new HttpRequest('put', sprintf('v1/agent/service/maintenance/%s', $serviceID), $this->_Config);
328328
$r->params->set('enable', 'false');
329329

330330
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
@@ -369,7 +369,7 @@ public function disableNodeMaintenance()
369369
*/
370370
public function checkPass($checkID, $note = '')
371371
{
372-
$r = new HttpRequest('get', sprintf('v1/agent/check/pass/%s', rawurlencode($checkID)), $this->_Config);
372+
$r = new HttpRequest('get', sprintf('v1/agent/check/pass/%s', $checkID), $this->_Config);
373373
$r->params->set('note', $note);
374374

375375
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
@@ -386,7 +386,7 @@ public function checkPass($checkID, $note = '')
386386
*/
387387
public function checkWarn($checkID, $note = '')
388388
{
389-
$r = new HttpRequest('get', sprintf('v1/agent/check/warn/%s', rawurlencode($checkID)), $this->_Config);
389+
$r = new HttpRequest('get', sprintf('v1/agent/check/warn/%s', $checkID), $this->_Config);
390390
$r->params->set('note', $note);
391391

392392
list($_, $_, $err) = $this->requireOK($this->doRequest($r));
@@ -403,7 +403,7 @@ public function checkWarn($checkID, $note = '')
403403
*/
404404
public function checkFail($checkID, $note = '')
405405
{
406-
$r = new HttpRequest('get', sprintf('v1/agent/check/fail/%s', rawurlencode($checkID)), $this->_Config);
406+
$r = new HttpRequest('get', sprintf('v1/agent/check/fail/%s', $checkID), $this->_Config);
407407
$r->params->set('note', $note);
408408

409409
list($_, $_, $err) = $this->requireOK($this->doRequest($r));

src/Catalog/CatalogClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function services(QueryOptions $queryOptions = null)
154154
*/
155155
public function service($service, $tag = '', QueryOptions $queryOptions = null)
156156
{
157-
$r = new HttpRequest('get', sprintf('v1/catalog/service/%s', rawurlencode($service)), $this->_Config);
157+
$r = new HttpRequest('get', sprintf('v1/catalog/service/%s', $service), $this->_Config);
158158
$r->setQueryOptions($queryOptions);
159159
if ('' !== $tag)
160160
$r->params->set('tag', $tag);
@@ -191,7 +191,7 @@ public function service($service, $tag = '', QueryOptions $queryOptions = null)
191191
*/
192192
public function node($node, QueryOptions $queryOptions = null)
193193
{
194-
$r = new HttpRequest('get', sprintf('v1/catalog/node/%s', rawurlencode($node)), $this->_Config);
194+
$r = new HttpRequest('get', sprintf('v1/catalog/node/%s', $node), $this->_Config);
195195
$r->setQueryOptions($queryOptions);
196196

197197
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));

src/Event/EventClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class EventClient extends AbstractApiClient
3939
*/
4040
public function fire(UserEvent $event, WriteOptions $writeOptions = null)
4141
{
42-
$r = new HttpRequest('put', sprintf('v1/event/fire/%s', rawurlencode($event->Name)), $this->_Config);
42+
$r = new HttpRequest('put', sprintf('v1/event/fire/%s', $event->Name), $this->_Config);
4343
$r->setWriteOptions($writeOptions);
4444

4545
if ('' !== ($nf = $event->NodeFilter))

src/Health/HealthClient.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function node($node, QueryOptions $queryOptions = null)
4848
))];
4949
}
5050

51-
$r = new HttpRequest('get', sprintf('v1/health/node/%s', rawurlencode($node)), $this->_Config);
51+
$r = new HttpRequest('get', sprintf('v1/health/node/%s', $node), $this->_Config);
5252
$r->setQueryOptions($queryOptions);
5353

5454
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
@@ -91,7 +91,7 @@ public function checks($service, QueryOptions $queryOptions = null)
9191
))];
9292
}
9393

94-
$r = new HttpRequest('get', sprintf('v1/health/checks/%s', rawurlencode($service)), $this->_Config);
94+
$r = new HttpRequest('get', sprintf('v1/health/checks/%s', $service), $this->_Config);
9595
$r->setQueryOptions($queryOptions);
9696

9797
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
@@ -134,7 +134,7 @@ public function service($service, QueryOptions $queryOptions = null)
134134
))];
135135
}
136136

137-
$r = new HttpRequest('get', sprintf('v1/health/checks/%s', rawurlencode($service)), $this->_Config);
137+
$r = new HttpRequest('get', sprintf('v1/health/checks/%s', $service), $this->_Config);
138138
$r->setQueryOptions($queryOptions);
139139

140140
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
@@ -180,7 +180,7 @@ public function state($state, QueryOptions $queryOptions = null)
180180
))];
181181
}
182182

183-
$r = new HttpRequest('get', sprintf('v1/health/state/%s', rawurlencode($state)), $this->_Config);
183+
$r = new HttpRequest('get', sprintf('v1/health/state/%s', $state), $this->_Config);
184184
$r->setQueryOptions($queryOptions);
185185

186186
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));

src/KV/KVClient.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function get($key, QueryOptions $queryOptions = null)
4949
))];
5050
}
5151

52-
$r = new HttpRequest('get', sprintf('v1/kv/%s', rawurlencode($key)), $this->_Config);
52+
$r = new HttpRequest('get', sprintf('v1/kv/%s', $key), $this->_Config);
5353
$r->setQueryOptions($queryOptions);
5454

5555
/** @var \DCarbone\PHPConsulAPI\HttpResponse $response */
@@ -97,7 +97,7 @@ public function valueList($prefix, QueryOptions $queryOptions = null)
9797
))];
9898
}
9999

100-
$r = new HttpRequest('get', sprintf('v1/kv/%s', rawurlencode($prefix)), $this->_Config);
100+
$r = new HttpRequest('get', sprintf('v1/kv/%s', $prefix), $this->_Config);
101101
$r->setQueryOptions($queryOptions);
102102
$r->params->set('recurse', '');
103103

@@ -145,7 +145,7 @@ public function keys($prefix = null, QueryOptions $queryOptions = null)
145145
if (null === $prefix)
146146
$r = new HttpRequest('get', 'v1/kv/', $this->_Config);
147147
else
148-
$r = new HttpRequest('get', sprintf('v1/kv/%s', rawurlencode($prefix)), $this->_Config);
148+
$r = new HttpRequest('get', sprintf('v1/kv/%s', $prefix), $this->_Config);
149149

150150
$r->setQueryOptions($queryOptions);
151151
$r->params->set('keys', true);
@@ -171,7 +171,7 @@ public function keys($prefix = null, QueryOptions $queryOptions = null)
171171
*/
172172
public function put(KVPair $KVPair, WriteOptions $writeOptions = null)
173173
{
174-
$r = new HttpRequest('put', sprintf('v1/kv/%s', rawurlencode($KVPair->Key)), $this->_Config);
174+
$r = new HttpRequest('put', sprintf('v1/kv/%s', $KVPair->Key), $this->_Config);
175175
$r->setWriteOptions($writeOptions);
176176
$r->body = ($KVPair);
177177

@@ -191,7 +191,7 @@ public function put(KVPair $KVPair, WriteOptions $writeOptions = null)
191191
*/
192192
public function delete($key, WriteOptions $writeOptions = null)
193193
{
194-
$r = new HttpRequest('delete', sprintf('v1/kv/%s', rawurlencode($key)), $this->_Config);
194+
$r = new HttpRequest('delete', sprintf('v1/kv/%s', $key), $this->_Config);
195195
$r->setWriteOptions($writeOptions);
196196

197197
list ($duration, $_, $err) = $this->requireOK($this->doRequest($r));

src/Session/SessionClient.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function destroy($id, WriteOptions $writeOptions = null)
111111
))];
112112
}
113113

114-
$r = new HttpRequest('put', sprintf('v1/session/destroy/%s', rawurlencode($id)), $this->_Config);
114+
$r = new HttpRequest('put', sprintf('v1/session/destroy/%s', $id), $this->_Config);
115115
$r->setWriteOptions($writeOptions);
116116

117117
list($duration, $_, $err) = $this->requireOK($this->doRequest($r));
@@ -140,7 +140,7 @@ public function renew($id, WriteOptions $writeOptions = null)
140140
))];
141141
}
142142

143-
$r = new HttpRequest('put', sprintf('v1/session/renew/%s', rawurlencode($id)), $this->_Config);
143+
$r = new HttpRequest('put', sprintf('v1/session/renew/%s', $id), $this->_Config);
144144
$r->setWriteOptions($writeOptions);
145145

146146
/** @var \Dcarbone\PHPConsulAPI\HttpResponse $response */
@@ -190,7 +190,7 @@ public function info($id, QueryOptions $queryOptions = null)
190190
))];
191191
}
192192

193-
$r = new HttpRequest('get', sprintf('v1/session/info/%s', rawurlencode($id)), $this->_Config);
193+
$r = new HttpRequest('get', sprintf('v1/session/info/%s', $id), $this->_Config);
194194
$r->setQueryOptions($queryOptions);
195195

196196
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
@@ -230,7 +230,7 @@ public function node($node, QueryOptions $queryOptions = null)
230230
))];
231231
}
232232

233-
$r = new HttpRequest('get', sprintf('v1/session/node/%s', rawurlencode($node)), $this->_Config);
233+
$r = new HttpRequest('get', sprintf('v1/session/node/%s', $node), $this->_Config);
234234
$r->setQueryOptions($queryOptions);
235235

236236
list($duration, $response, $err) = $this->requireOK($this->doRequest($r));

0 commit comments

Comments
 (0)