My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 1 attachment: Client.patch (900 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Index: Client.php
===================================================================
--- Client.php (revision 2)
+++ Client.php (working copy)
@@ -44,8 +44,15 @@
* @var string
*/
protected $_url;
-
+
/**
+ * json decode returns an associative array
+ *
+ * @var boolean
+ */
+ protected $_assoc = false;
+
+ /**
* Notification mode
*
* @var boolean
@@ -56,9 +63,11 @@
* Constructor
*
* @param string $url
+ * @param boolean $assoc
*/
- public function __construct($url) {
+ public function __construct($url, $assoc = false) {
$this->_url = $url;
+ $this->_assoc = $assoc;
}

/**
@@ -98,7 +107,7 @@
throw new Exception('Unable to connect to ' . $this->_url);
}

- $response = json_decode($response);
+ $response = json_decode($response, $this->_assoc);
if ($response === null) {
throw new Exception('Malformed response');
}
Powered by Google Project Hosting