@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
3 | - require $vdir.'/../vendor/autoload.php'; |
|
3 | + require $vdir.'/../vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | use Route4Me\MyQ; |
6 | 6 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
2 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
3 | 3 | require $vdir.'/../vendor/autoload.php'; |
4 | 4 | |
5 | 5 | use Route4Me\MyQ; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Order; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Order; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 |
@@ -204,6 +204,9 @@ |
||
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
207 | + /** |
|
208 | + * @param string $url |
|
209 | + */ |
|
207 | 210 | public static function makeUrlRequst($url, $options) { |
208 | 211 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
209 | 212 | $query = isset($options['query']) ? |
@@ -6,37 +6,37 @@ discard block |
||
6 | 6 | |
7 | 7 | class Route4Me |
8 | 8 | { |
9 | - static public $apiKey; |
|
10 | - static public $baseUrl = 'https://route4me.com'; |
|
9 | + static public $apiKey; |
|
10 | + static public $baseUrl = 'https://route4me.com'; |
|
11 | 11 | |
12 | - public static function setApiKey($apiKey) |
|
13 | - { |
|
14 | - self::$apiKey = $apiKey; |
|
15 | - } |
|
12 | + public static function setApiKey($apiKey) |
|
13 | + { |
|
14 | + self::$apiKey = $apiKey; |
|
15 | + } |
|
16 | 16 | |
17 | - public static function getApiKey() |
|
18 | - { |
|
19 | - return self::$apiKey; |
|
20 | - } |
|
17 | + public static function getApiKey() |
|
18 | + { |
|
19 | + return self::$apiKey; |
|
20 | + } |
|
21 | 21 | |
22 | - public static function setBaseUrl($baseUrl) |
|
23 | - { |
|
24 | - self::$baseUrl = $baseUrl; |
|
25 | - } |
|
22 | + public static function setBaseUrl($baseUrl) |
|
23 | + { |
|
24 | + self::$baseUrl = $baseUrl; |
|
25 | + } |
|
26 | 26 | |
27 | - public static function getBaseUrl() |
|
28 | - { |
|
29 | - return self::$baseUrl; |
|
30 | - } |
|
27 | + public static function getBaseUrl() |
|
28 | + { |
|
29 | + return self::$baseUrl; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | public static function fileUploadRequest($options) { |
33 | 33 | $query = isset($options['query']) ? |
34 | - array_filter($options['query']) : array(); |
|
34 | + array_filter($options['query']) : array(); |
|
35 | 35 | |
36 | 36 | if (sizeof($query)==0) return null; |
37 | 37 | |
38 | 38 | $body = isset($options['body']) ? |
39 | - array_filter($options['body']) : null; |
|
39 | + array_filter($options['body']) : null; |
|
40 | 40 | |
41 | 41 | $fname = isset($body['strFilename']) ? $body['strFilename'] : ''; |
42 | 42 | if ($fname=='') return null; |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $fp=fopen(realpath($fname),"r"); |
47 | 47 | |
48 | 48 | $url = self::$baseUrl.$options['url'] . '?' . http_build_query(array_merge( |
49 | - array( 'api_key' => self::getApiKey()), $query) |
|
50 | - ); |
|
49 | + array( 'api_key' => self::getApiKey()), $query) |
|
50 | + ); |
|
51 | 51 | |
52 | 52 | //self::simplePrint($body);die(""); |
53 | 53 | //echo "url=".$url."<br>";die(""); |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | $ch = curl_init($url); |
56 | 56 | |
57 | 57 | $curlOpts = array( |
58 | - CURLOPT_RETURNTRANSFER => true, |
|
59 | - CURLOPT_TIMEOUT => 60, |
|
60 | - CURLOPT_FOLLOWLOCATION => true, |
|
61 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
62 | - CURLOPT_SSL_VERIFYPEER => FALSE |
|
63 | - ); |
|
58 | + CURLOPT_RETURNTRANSFER => true, |
|
59 | + CURLOPT_TIMEOUT => 60, |
|
60 | + CURLOPT_FOLLOWLOCATION => true, |
|
61 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
62 | + CURLOPT_SSL_VERIFYPEER => FALSE |
|
63 | + ); |
|
64 | 64 | |
65 | 65 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
66 | 66 | |
@@ -76,62 +76,62 @@ discard block |
||
76 | 76 | fclose($fp); |
77 | 77 | //var_dump($result); die(''); |
78 | 78 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
79 | - curl_close($ch); |
|
79 | + curl_close($ch); |
|
80 | 80 | //echo "code = $code <br>"; |
81 | 81 | $json = json_decode($result, true); |
82 | 82 | //var_dump($json); die(""); |
83 | - if (200 == $code) { |
|
84 | - return $json; |
|
85 | - } elseif (isset($json['errors'])) { |
|
86 | - throw new ApiError(implode(', ', $json['errors'])); |
|
87 | - } else { |
|
88 | - throw new ApiError('Something wrong'); |
|
89 | - } |
|
83 | + if (200 == $code) { |
|
84 | + return $json; |
|
85 | + } elseif (isset($json['errors'])) { |
|
86 | + throw new ApiError(implode(', ', $json['errors'])); |
|
87 | + } else { |
|
88 | + throw new ApiError('Something wrong'); |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | - public static function makeRequst($options) { |
|
93 | - $method = isset($options['method']) ? $options['method'] : 'GET'; |
|
94 | - $query = isset($options['query']) ? |
|
95 | - array_filter($options['query']) : array(); |
|
92 | + public static function makeRequst($options) { |
|
93 | + $method = isset($options['method']) ? $options['method'] : 'GET'; |
|
94 | + $query = isset($options['query']) ? |
|
95 | + array_filter($options['query']) : array(); |
|
96 | 96 | //echo "query=".$query['member_id'];die(""); |
97 | - $body = isset($options['body']) ? |
|
98 | - array_filter($options['body']) : null; |
|
97 | + $body = isset($options['body']) ? |
|
98 | + array_filter($options['body']) : null; |
|
99 | 99 | $file = isset($options['FILE']) ? $options['FILE'] : null; |
100 | - $headers = array( |
|
101 | - "User-Agent: Route4Me php-sdk" |
|
102 | - ); |
|
100 | + $headers = array( |
|
101 | + "User-Agent: Route4Me php-sdk" |
|
102 | + ); |
|
103 | 103 | |
104 | - if (isset($options['HTTPHEADER'])) { |
|
105 | - $headers[]=$options['HTTPHEADER']; |
|
106 | - } |
|
104 | + if (isset($options['HTTPHEADER'])) { |
|
105 | + $headers[]=$options['HTTPHEADER']; |
|
106 | + } |
|
107 | 107 | |
108 | 108 | if (isset($options['HTTPHEADERS'])) { |
109 | - foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
110 | - } |
|
111 | - //self::simplePrint($headers); die(""); |
|
112 | - $ch = curl_init(); |
|
113 | - $url = $options['url'] . '?' . http_build_query(array_merge( |
|
114 | - $query, array( 'api_key' => self::getApiKey()) |
|
115 | - )); |
|
109 | + foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
110 | + } |
|
111 | + //self::simplePrint($headers); die(""); |
|
112 | + $ch = curl_init(); |
|
113 | + $url = $options['url'] . '?' . http_build_query(array_merge( |
|
114 | + $query, array( 'api_key' => self::getApiKey()) |
|
115 | + )); |
|
116 | 116 | |
117 | 117 | //$jfile=json_encode($body); echo $jfile; die(""); |
118 | 118 | |
119 | - //self::simplePrint($headers); die(""); |
|
119 | + //self::simplePrint($headers); die(""); |
|
120 | 120 | $baseUrl=self::getBaseUrl(); |
121 | 121 | |
122 | 122 | if (strpos($url,'move_route_destination')>0) $baseUrl='https://www.route4me.com'; |
123 | - $curlOpts = arraY( |
|
124 | - CURLOPT_URL => $baseUrl. $url, |
|
125 | - CURLOPT_RETURNTRANSFER => true, |
|
126 | - CURLOPT_TIMEOUT => 60, |
|
127 | - CURLOPT_FOLLOWLOCATION => true, |
|
128 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
129 | - CURLOPT_SSL_VERIFYPEER => FALSE, |
|
130 | - CURLOPT_HTTPHEADER => $headers |
|
131 | - ); |
|
123 | + $curlOpts = arraY( |
|
124 | + CURLOPT_URL => $baseUrl. $url, |
|
125 | + CURLOPT_RETURNTRANSFER => true, |
|
126 | + CURLOPT_TIMEOUT => 60, |
|
127 | + CURLOPT_FOLLOWLOCATION => true, |
|
128 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
129 | + CURLOPT_SSL_VERIFYPEER => FALSE, |
|
130 | + CURLOPT_HTTPHEADER => $headers |
|
131 | + ); |
|
132 | 132 | |
133 | 133 | //echo "url=".$baseUrl.$url."<br>";die(""); |
134 | - curl_setopt_array($ch, $curlOpts); |
|
134 | + curl_setopt_array($ch, $curlOpts); |
|
135 | 135 | |
136 | 136 | if ($file !=null) { |
137 | 137 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
@@ -140,21 +140,21 @@ discard block |
||
140 | 140 | curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file)); |
141 | 141 | } |
142 | 142 | |
143 | - switch($method) { |
|
144 | - case 'DELETE': |
|
145 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
143 | + switch($method) { |
|
144 | + case 'DELETE': |
|
145 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
146 | 146 | |
147 | 147 | if (isset($body)) { |
148 | 148 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
149 | 149 | } |
150 | - break; |
|
150 | + break; |
|
151 | 151 | case 'DELETEARRAY': |
152 | 152 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
153 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
154 | - break; |
|
155 | - case 'PUT': |
|
153 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
154 | + break; |
|
155 | + case 'PUT': |
|
156 | 156 | //$jfile=json_encode($body); echo $jfile; die(""); |
157 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
157 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
158 | 158 | if (isset($query)) { |
159 | 159 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
160 | 160 | } |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
164 | 164 | } |
165 | 165 | break; |
166 | - case 'POST': |
|
166 | + case 'POST': |
|
167 | 167 | if (isset($query)) { |
168 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
168 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | //echo json_encode($body); die(""); |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | } |
175 | 175 | break; |
176 | 176 | case 'ADD': |
177 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
178 | - } |
|
177 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
178 | + } |
|
179 | 179 | |
180 | - $result = curl_exec($ch); |
|
180 | + $result = curl_exec($ch); |
|
181 | 181 | //var_dump($result); die(""); |
182 | 182 | $isxml=FALSE; |
183 | 183 | $jxml=""; |
@@ -188,58 +188,58 @@ discard block |
||
188 | 188 | $isxml = TRUE; |
189 | 189 | } |
190 | 190 | |
191 | - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
192 | - curl_close($ch); |
|
191 | + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
192 | + curl_close($ch); |
|
193 | 193 | |
194 | 194 | if ($isxml) { |
195 | 195 | $json = $jxml; |
196 | 196 | } else $json = json_decode($result, true); |
197 | 197 | //var_dump($json); die(""); |
198 | - if (200 == $code) { |
|
199 | - return $json; |
|
200 | - } elseif (isset($json['errors'])) { |
|
201 | - throw new ApiError(implode(', ', $json['errors'])); |
|
202 | - } else { |
|
203 | - throw new ApiError('Something wrong'); |
|
204 | - } |
|
205 | - } |
|
198 | + if (200 == $code) { |
|
199 | + return $json; |
|
200 | + } elseif (isset($json['errors'])) { |
|
201 | + throw new ApiError(implode(', ', $json['errors'])); |
|
202 | + } else { |
|
203 | + throw new ApiError('Something wrong'); |
|
204 | + } |
|
205 | + } |
|
206 | 206 | |
207 | 207 | public static function makeUrlRequst($url, $options) { |
208 | 208 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
209 | - $query = isset($options['query']) ? |
|
210 | - array_filter($options['query']) : array(); |
|
211 | - $body = isset($options['body']) ? |
|
212 | - array_filter($options['body']) : null; |
|
213 | - $ch = curl_init(); |
|
209 | + $query = isset($options['query']) ? |
|
210 | + array_filter($options['query']) : array(); |
|
211 | + $body = isset($options['body']) ? |
|
212 | + array_filter($options['body']) : null; |
|
213 | + $ch = curl_init(); |
|
214 | 214 | |
215 | 215 | $curlOpts = arraY( |
216 | - CURLOPT_URL => $url, |
|
217 | - CURLOPT_RETURNTRANSFER => true, |
|
218 | - CURLOPT_TIMEOUT => 60, |
|
219 | - CURLOPT_FOLLOWLOCATION => true, |
|
220 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
221 | - CURLOPT_SSL_VERIFYPEER => FALSE, |
|
222 | - CURLOPT_HTTPHEADER => array( |
|
223 | - 'User-Agent' => 'Route4Me php-sdk' |
|
224 | - ) |
|
225 | - ); |
|
216 | + CURLOPT_URL => $url, |
|
217 | + CURLOPT_RETURNTRANSFER => true, |
|
218 | + CURLOPT_TIMEOUT => 60, |
|
219 | + CURLOPT_FOLLOWLOCATION => true, |
|
220 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
221 | + CURLOPT_SSL_VERIFYPEER => FALSE, |
|
222 | + CURLOPT_HTTPHEADER => array( |
|
223 | + 'User-Agent' => 'Route4Me php-sdk' |
|
224 | + ) |
|
225 | + ); |
|
226 | 226 | |
227 | 227 | curl_setopt_array($ch, $curlOpts); |
228 | 228 | |
229 | - switch($method) { |
|
230 | - case 'DELETE': |
|
231 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
229 | + switch($method) { |
|
230 | + case 'DELETE': |
|
231 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
232 | 232 | |
233 | 233 | if (isset($body)) { |
234 | 234 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
235 | 235 | } |
236 | - break; |
|
236 | + break; |
|
237 | 237 | case 'DELETEARRAY': |
238 | 238 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
239 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
240 | - break; |
|
241 | - case 'PUT': |
|
242 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
239 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
240 | + break; |
|
241 | + case 'PUT': |
|
242 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
243 | 243 | if (isset($query)) { |
244 | 244 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
245 | 245 | } |
@@ -248,10 +248,10 @@ discard block |
||
248 | 248 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
249 | 249 | } |
250 | 250 | break; |
251 | - case 'POST': |
|
251 | + case 'POST': |
|
252 | 252 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
253 | 253 | if (isset($query)) { |
254 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
254 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | if (isset($body)) { |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | } |
260 | 260 | break; |
261 | 261 | case 'ADD': |
262 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
263 | - } |
|
262 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
263 | + } |
|
264 | 264 | |
265 | 265 | $result = curl_exec($ch); |
266 | 266 | |
@@ -273,21 +273,21 @@ discard block |
||
273 | 273 | $isxml = TRUE; |
274 | 274 | } |
275 | 275 | |
276 | - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
277 | - curl_close($ch); |
|
276 | + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
277 | + curl_close($ch); |
|
278 | 278 | |
279 | 279 | if ($isxml) { |
280 | 280 | $json = $jxml; |
281 | 281 | } else $json = json_decode($result, true); |
282 | 282 | |
283 | 283 | |
284 | - if (200 == $code) { |
|
285 | - return $json; |
|
286 | - } elseif (isset($json['errors'])) { |
|
287 | - throw new ApiError(implode(', ', $json['errors'])); |
|
288 | - } else { |
|
289 | - throw new ApiError('Something wrong'); |
|
290 | - } |
|
284 | + if (200 == $code) { |
|
285 | + return $json; |
|
286 | + } elseif (isset($json['errors'])) { |
|
287 | + throw new ApiError(implode(', ', $json['errors'])); |
|
288 | + } else { |
|
289 | + throw new ApiError('Something wrong'); |
|
290 | + } |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | |
44 | 44 | $rpath = realpath($fname); |
45 | 45 | |
46 | - $fp=fopen(realpath($fname),"r"); |
|
46 | + $fp = fopen(realpath($fname), "r"); |
|
47 | 47 | |
48 | - $url = self::$baseUrl.$options['url'] . '?' . http_build_query(array_merge( |
|
49 | - array( 'api_key' => self::getApiKey()), $query) |
|
48 | + $url = self::$baseUrl.$options['url'].'?'.http_build_query(array_merge( |
|
49 | + array('api_key' => self::getApiKey()), $query) |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | //self::simplePrint($body);die(""); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | //echo "code = $code <br>"; |
81 | 81 | $json = json_decode($result, true); |
82 | 82 | //var_dump($json); die(""); |
83 | - if (200 == $code) { |
|
83 | + if (200==$code) { |
|
84 | 84 | return $json; |
85 | 85 | } elseif (isset($json['errors'])) { |
86 | 86 | throw new ApiError(implode(', ', $json['errors'])); |
@@ -102,26 +102,26 @@ discard block |
||
102 | 102 | ); |
103 | 103 | |
104 | 104 | if (isset($options['HTTPHEADER'])) { |
105 | - $headers[]=$options['HTTPHEADER']; |
|
105 | + $headers[] = $options['HTTPHEADER']; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (isset($options['HTTPHEADERS'])) { |
109 | - foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
109 | + foreach ($options['HTTPHEADERS'] As $header) $headers[] = $header; |
|
110 | 110 | } |
111 | 111 | //self::simplePrint($headers); die(""); |
112 | 112 | $ch = curl_init(); |
113 | - $url = $options['url'] . '?' . http_build_query(array_merge( |
|
114 | - $query, array( 'api_key' => self::getApiKey()) |
|
113 | + $url = $options['url'].'?'.http_build_query(array_merge( |
|
114 | + $query, array('api_key' => self::getApiKey()) |
|
115 | 115 | )); |
116 | 116 | |
117 | 117 | //$jfile=json_encode($body); echo $jfile; die(""); |
118 | 118 | |
119 | 119 | //self::simplePrint($headers); die(""); |
120 | - $baseUrl=self::getBaseUrl(); |
|
120 | + $baseUrl = self::getBaseUrl(); |
|
121 | 121 | |
122 | - if (strpos($url,'move_route_destination')>0) $baseUrl='https://www.route4me.com'; |
|
122 | + if (strpos($url, 'move_route_destination')>0) $baseUrl = 'https://www.route4me.com'; |
|
123 | 123 | $curlOpts = arraY( |
124 | - CURLOPT_URL => $baseUrl. $url, |
|
124 | + CURLOPT_URL => $baseUrl.$url, |
|
125 | 125 | CURLOPT_RETURNTRANSFER => true, |
126 | 126 | CURLOPT_TIMEOUT => 60, |
127 | 127 | CURLOPT_FOLLOWLOCATION => true, |
@@ -133,14 +133,14 @@ discard block |
||
133 | 133 | //echo "url=".$baseUrl.$url."<br>";die(""); |
134 | 134 | curl_setopt_array($ch, $curlOpts); |
135 | 135 | |
136 | - if ($file !=null) { |
|
136 | + if ($file!=null) { |
|
137 | 137 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
138 | - $fp=fopen($file,'r'); |
|
139 | - curl_setopt($ch, CURLOPT_INFILE , $fp); |
|
138 | + $fp = fopen($file, 'r'); |
|
139 | + curl_setopt($ch, CURLOPT_INFILE, $fp); |
|
140 | 140 | curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file)); |
141 | 141 | } |
142 | 142 | |
143 | - switch($method) { |
|
143 | + switch ($method) { |
|
144 | 144 | case 'DELETE': |
145 | 145 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
146 | 146 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | break; |
166 | 166 | case 'POST': |
167 | 167 | if (isset($query)) { |
168 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
168 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | //echo json_encode($body); die(""); |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | |
180 | 180 | $result = curl_exec($ch); |
181 | 181 | //var_dump($result); die(""); |
182 | - $isxml=FALSE; |
|
183 | - $jxml=""; |
|
182 | + $isxml = FALSE; |
|
183 | + $jxml = ""; |
|
184 | 184 | if (strpos($result, '<?xml')>-1) |
185 | 185 | { |
186 | 186 | $xml = simplexml_load_string($result); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $json = $jxml; |
196 | 196 | } else $json = json_decode($result, true); |
197 | 197 | //var_dump($json); die(""); |
198 | - if (200 == $code) { |
|
198 | + if (200==$code) { |
|
199 | 199 | return $json; |
200 | 200 | } elseif (isset($json['errors'])) { |
201 | 201 | throw new ApiError(implode(', ', $json['errors'])); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | curl_setopt_array($ch, $curlOpts); |
228 | 228 | |
229 | - switch($method) { |
|
229 | + switch ($method) { |
|
230 | 230 | case 'DELETE': |
231 | 231 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
232 | 232 | |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | |
265 | 265 | $result = curl_exec($ch); |
266 | 266 | |
267 | - $isxml=FALSE; |
|
268 | - $jxml=""; |
|
267 | + $isxml = FALSE; |
|
268 | + $jxml = ""; |
|
269 | 269 | if (strpos($result, '<?xml')>-1) |
270 | 270 | { |
271 | 271 | $xml = simplexml_load_string($result); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } else $json = json_decode($result, true); |
282 | 282 | |
283 | 283 | |
284 | - if (200 == $code) { |
|
284 | + if (200==$code) { |
|
285 | 285 | return $json; |
286 | 286 | } elseif (isset($json['errors'])) { |
287 | 287 | throw new ApiError(implode(', ', $json['errors'])); |
@@ -33,13 +33,17 @@ discard block |
||
33 | 33 | $query = isset($options['query']) ? |
34 | 34 | array_filter($options['query']) : array(); |
35 | 35 | |
36 | - if (sizeof($query)==0) return null; |
|
36 | + if (sizeof($query)==0) { |
|
37 | + return null; |
|
38 | + } |
|
37 | 39 | |
38 | 40 | $body = isset($options['body']) ? |
39 | 41 | array_filter($options['body']) : null; |
40 | 42 | |
41 | 43 | $fname = isset($body['strFilename']) ? $body['strFilename'] : ''; |
42 | - if ($fname=='') return null; |
|
44 | + if ($fname=='') { |
|
45 | + return null; |
|
46 | + } |
|
43 | 47 | |
44 | 48 | $rpath = realpath($fname); |
45 | 49 | |
@@ -106,7 +110,9 @@ discard block |
||
106 | 110 | } |
107 | 111 | |
108 | 112 | if (isset($options['HTTPHEADERS'])) { |
109 | - foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
113 | + foreach ($options['HTTPHEADERS'] As $header) { |
|
114 | + $headers[]=$header; |
|
115 | + } |
|
110 | 116 | } |
111 | 117 | //self::simplePrint($headers); die(""); |
112 | 118 | $ch = curl_init(); |
@@ -119,7 +125,9 @@ discard block |
||
119 | 125 | //self::simplePrint($headers); die(""); |
120 | 126 | $baseUrl=self::getBaseUrl(); |
121 | 127 | |
122 | - if (strpos($url,'move_route_destination')>0) $baseUrl='https://www.route4me.com'; |
|
128 | + if (strpos($url,'move_route_destination')>0) { |
|
129 | + $baseUrl='https://www.route4me.com'; |
|
130 | + } |
|
123 | 131 | $curlOpts = arraY( |
124 | 132 | CURLOPT_URL => $baseUrl. $url, |
125 | 133 | CURLOPT_RETURNTRANSFER => true, |
@@ -193,7 +201,9 @@ discard block |
||
193 | 201 | |
194 | 202 | if ($isxml) { |
195 | 203 | $json = $jxml; |
196 | - } else $json = json_decode($result, true); |
|
204 | + } else { |
|
205 | + $json = json_decode($result, true); |
|
206 | + } |
|
197 | 207 | //var_dump($json); die(""); |
198 | 208 | if (200 == $code) { |
199 | 209 | return $json; |
@@ -278,7 +288,9 @@ discard block |
||
278 | 288 | |
279 | 289 | if ($isxml) { |
280 | 290 | $json = $jxml; |
281 | - } else $json = json_decode($result, true); |
|
291 | + } else { |
|
292 | + $json = json_decode($result, true); |
|
293 | + } |
|
282 | 294 | |
283 | 295 | |
284 | 296 | if (200 == $code) { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
3 | - require $vdir.'/../vendor/autoload.php'; |
|
3 | + require $vdir.'/../vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | use Route4Me\MyQ; |
6 | 6 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
2 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
3 | 3 | require $vdir.'/../vendor/autoload.php'; |
4 | 4 | |
5 | 5 | use Route4Me\MyQ; |
@@ -68,60 +68,60 @@ discard block |
||
68 | 68 | |
69 | 69 | public static function fromArray(array $params) { |
70 | 70 | $member= new Member(); |
71 | - foreach($params as $key => $value) { |
|
72 | - if (property_exists($member, $key)) { |
|
73 | - $member->{$key} = $value; |
|
74 | - } |
|
71 | + foreach($params as $key => $value) { |
|
72 | + if (property_exists($member, $key)) { |
|
73 | + $member->{$key} = $value; |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $member; |
78 | 78 | } |
79 | 79 | |
80 | 80 | public static function getUsers() |
81 | - { |
|
82 | - $response = Route4Me::makeRequst(array( |
|
83 | - 'url' => self::$apiUrl, |
|
84 | - 'method' => 'GET' |
|
85 | - )); |
|
81 | + { |
|
82 | + $response = Route4Me::makeRequst(array( |
|
83 | + 'url' => self::$apiUrl, |
|
84 | + 'method' => 'GET' |
|
85 | + )); |
|
86 | 86 | //var_dump($response); die(""); |
87 | 87 | return $response; |
88 | 88 | } |
89 | 89 | |
90 | 90 | public static function getUser($params) |
91 | - { |
|
92 | - $response = Route4Me::makeRequst(array( |
|
93 | - 'url' => self::$apiUrl, |
|
94 | - 'method' => 'GET', |
|
95 | - 'query' => array( |
|
96 | - 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
91 | + { |
|
92 | + $response = Route4Me::makeRequst(array( |
|
93 | + 'url' => self::$apiUrl, |
|
94 | + 'method' => 'GET', |
|
95 | + 'query' => array( |
|
96 | + 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
97 | 97 | ) |
98 | - )); |
|
98 | + )); |
|
99 | 99 | //var_dump($response); die(""); |
100 | 100 | return $response; |
101 | 101 | } |
102 | 102 | |
103 | 103 | public static function getUserLocations($param) |
104 | - { |
|
105 | - $response = Route4Me::makeRequst(array( |
|
106 | - 'url' => self::$apiUserLocations, |
|
107 | - 'method' => 'GET', |
|
108 | - 'query' => array( |
|
109 | - 'query' => $param |
|
104 | + { |
|
105 | + $response = Route4Me::makeRequst(array( |
|
106 | + 'url' => self::$apiUserLocations, |
|
107 | + 'method' => 'GET', |
|
108 | + 'query' => array( |
|
109 | + 'query' => $param |
|
110 | 110 | ) |
111 | - )); |
|
111 | + )); |
|
112 | 112 | //var_dump($response); die(""); |
113 | 113 | return $response; |
114 | 114 | } |
115 | 115 | |
116 | 116 | public static function addDeviceRecord($body) |
117 | - { |
|
118 | - $response = Route4Me::makeRequst(array( |
|
119 | - 'url' => self::$apiUrlDevice, |
|
120 | - 'method' => 'POST', |
|
121 | - 'body' => array( |
|
117 | + { |
|
118 | + $response = Route4Me::makeRequst(array( |
|
119 | + 'url' => self::$apiUrlDevice, |
|
120 | + 'method' => 'POST', |
|
121 | + 'body' => array( |
|
122 | 122 | 'device_id' => isset($body->device_id) ? $body->device_id: null, |
123 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | - 'format' => isset($body->format) ? $body->format : null |
|
123 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | + 'format' => isset($body->format) ? $body->format : null |
|
125 | 125 | ) |
126 | 126 | |
127 | 127 | )); |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | public static function createMember($body) |
132 | - { |
|
133 | - $response = Route4Me::makeRequst(array( |
|
134 | - 'url' => self::$apiUrl, |
|
135 | - 'method' => 'POST', |
|
136 | - 'body' => array( |
|
132 | + { |
|
133 | + $response = Route4Me::makeRequst(array( |
|
134 | + 'url' => self::$apiUrl, |
|
135 | + 'method' => 'POST', |
|
136 | + 'body' => array( |
|
137 | 137 | 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
138 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
138 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
151 | 151 | ) |
152 | 152 | |
153 | 153 | )); |
@@ -155,26 +155,26 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | public static function updateMember($body) |
158 | - { |
|
159 | - $response = Route4Me::makeRequst(array( |
|
160 | - 'url' => self::$apiUrl, |
|
161 | - 'method' => 'PUT', |
|
162 | - 'body' => array( |
|
158 | + { |
|
159 | + $response = Route4Me::makeRequst(array( |
|
160 | + 'url' => self::$apiUrl, |
|
161 | + 'method' => 'PUT', |
|
162 | + 'body' => array( |
|
163 | 163 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
164 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
164 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
178 | 178 | ) |
179 | 179 | |
180 | 180 | )); |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | public static function deleteMember($body) |
185 | - { |
|
186 | - $response = Route4Me::makeRequst(array( |
|
187 | - 'url' => self::$apiUrl, |
|
188 | - 'method' => 'DELETE', |
|
189 | - 'body' => array( |
|
185 | + { |
|
186 | + $response = Route4Me::makeRequst(array( |
|
187 | + 'url' => self::$apiUrl, |
|
188 | + 'method' => 'DELETE', |
|
189 | + 'body' => array( |
|
190 | 190 | 'member_id' => isset($body->member_id) ? $body->member_id: null |
191 | 191 | ) |
192 | 192 | |
@@ -195,50 +195,50 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | public static function newAccountRegistration($body) |
198 | - { |
|
199 | - $response = Route4Me::makeRequst(array( |
|
200 | - 'url' => self::$apiUrlRegistr, |
|
201 | - 'method' => 'POST', |
|
202 | - 'body' => array( |
|
198 | + { |
|
199 | + $response = Route4Me::makeRequst(array( |
|
200 | + 'url' => self::$apiUrlRegistr, |
|
201 | + 'method' => 'POST', |
|
202 | + 'body' => array( |
|
203 | 203 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
204 | - 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | - 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | - 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | - 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | - 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | - 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | - 'plan' => isset($body->plan) ? $body->plan: null, |
|
211 | - 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType: null, |
|
212 | - 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing: false, |
|
213 | - 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail: false |
|
204 | + 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | + 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | + 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | + 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | + 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | + 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | + 'plan' => isset($body->plan) ? $body->plan: null, |
|
211 | + 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType: null, |
|
212 | + 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing: false, |
|
213 | + 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail: false |
|
214 | 214 | ) |
215 | 215 | )); |
216 | 216 | return $response; |
217 | 217 | } |
218 | 218 | |
219 | 219 | public static function validateSession($params) |
220 | - { |
|
221 | - $response = Route4Me::makeRequst(array( |
|
222 | - 'url' => self::$apiUrlSessValid, |
|
223 | - 'method' => 'GET', |
|
224 | - 'query' => array( |
|
220 | + { |
|
221 | + $response = Route4Me::makeRequst(array( |
|
222 | + 'url' => self::$apiUrlSessValid, |
|
223 | + 'method' => 'GET', |
|
224 | + 'query' => array( |
|
225 | 225 | 'session_guid' => isset($params->session_guid) ? $params->session_guid: null, |
226 | - 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
227 | - 'format' => isset($params->format) ? $params->format : null |
|
226 | + 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
227 | + 'format' => isset($params->format) ? $params->format : null |
|
228 | 228 | ) |
229 | 229 | )); |
230 | 230 | return $response; |
231 | 231 | } |
232 | 232 | |
233 | 233 | public static function memberAuthentication($body) |
234 | - { |
|
235 | - $response = Route4Me::makeRequst(array( |
|
236 | - 'url' => self::$apiUrlAuthen, |
|
237 | - 'method' => 'POST', |
|
238 | - 'body' => array( |
|
234 | + { |
|
235 | + $response = Route4Me::makeRequst(array( |
|
236 | + 'url' => self::$apiUrlAuthen, |
|
237 | + 'method' => 'POST', |
|
238 | + 'body' => array( |
|
239 | 239 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
240 | - 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
241 | - 'format' => isset($body->format) ? $body->format : null |
|
240 | + 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
241 | + 'format' => isset($body->format) ? $body->format : null |
|
242 | 242 | ) |
243 | 243 | |
244 | 244 | )); |
@@ -246,18 +246,18 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | public static function webinarRegistration($body) |
249 | - { |
|
250 | - $response = Route4Me::makeRequst(array( |
|
251 | - 'url' => self::$apiUrlWebinar, |
|
252 | - 'method' => 'POST', |
|
253 | - 'body' => array( |
|
249 | + { |
|
250 | + $response = Route4Me::makeRequst(array( |
|
251 | + 'url' => self::$apiUrlWebinar, |
|
252 | + 'method' => 'POST', |
|
253 | + 'body' => array( |
|
254 | 254 | 'email_address' => isset($body->email_address) ? $body->email_address: null, |
255 | - 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
256 | - 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
257 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
258 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
259 | - 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
260 | - 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
255 | + 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
256 | + 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
257 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
258 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
259 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
260 | + 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
261 | 261 | ) |
262 | 262 | |
263 | 263 | )); |
@@ -265,19 +265,19 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | public static function purchaseUserLicense($body) |
268 | - { |
|
269 | - $response = Route4Me::makeRequst(array( |
|
270 | - 'url' => self::$apiUrlLicense, |
|
271 | - 'method' => 'POST', |
|
272 | - 'body' => array( |
|
268 | + { |
|
269 | + $response = Route4Me::makeRequst(array( |
|
270 | + 'url' => self::$apiUrlLicense, |
|
271 | + 'method' => 'POST', |
|
272 | + 'body' => array( |
|
273 | 273 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
274 | - 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
275 | - 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
276 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
277 | - 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
278 | - 'token' => isset($body->token) ? $body->token : null, |
|
279 | - 'payload' => isset($body->payload) ? $body->payload : null, |
|
280 | - 'format' => isset($body->format) ? $body->format : null, |
|
274 | + 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
275 | + 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
276 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
277 | + 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
278 | + 'token' => isset($body->token) ? $body->token : null, |
|
279 | + 'payload' => isset($body->payload) ? $body->payload : null, |
|
280 | + 'format' => isset($body->format) ? $body->format : null, |
|
281 | 281 | ) |
282 | 282 | |
283 | 283 | )); |
@@ -285,24 +285,24 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | public static function newMemberConfigKey($body) |
288 | - { |
|
289 | - $response = Route4Me::makeRequst(array( |
|
290 | - 'url' => self::$apiMemberConfig, |
|
291 | - 'method' => 'POST', |
|
292 | - 'body' => array( |
|
288 | + { |
|
289 | + $response = Route4Me::makeRequst(array( |
|
290 | + 'url' => self::$apiMemberConfig, |
|
291 | + 'method' => 'POST', |
|
292 | + 'body' => array( |
|
293 | 293 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
294 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
294 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
295 | 295 | ) |
296 | 296 | )); |
297 | 297 | return $response; |
298 | 298 | } |
299 | 299 | |
300 | 300 | public static function removeMemberConfigKey($body) |
301 | - { |
|
302 | - $response = Route4Me::makeRequst(array( |
|
303 | - 'url' => self::$apiMemberConfig, |
|
304 | - 'method' => 'DELETE', |
|
305 | - 'body' => array( |
|
301 | + { |
|
302 | + $response = Route4Me::makeRequst(array( |
|
303 | + 'url' => self::$apiMemberConfig, |
|
304 | + 'method' => 'DELETE', |
|
305 | + 'body' => array( |
|
306 | 306 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
307 | 307 | ) |
308 | 308 | )); |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | public static function getMemberConfigData($body) |
313 | - { |
|
314 | - $response = Route4Me::makeRequst(array( |
|
315 | - 'url' => self::$apiMemberConfig, |
|
316 | - 'method' => 'GET', |
|
317 | - 'query' => array( |
|
313 | + { |
|
314 | + $response = Route4Me::makeRequst(array( |
|
315 | + 'url' => self::$apiMemberConfig, |
|
316 | + 'method' => 'GET', |
|
317 | + 'query' => array( |
|
318 | 318 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
319 | 319 | ) |
320 | 320 | )); |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | public static function updateMemberConfigKey($body) |
325 | - { |
|
326 | - $response = Route4Me::makeRequst(array( |
|
327 | - 'url' => self::$apiMemberConfig, |
|
328 | - 'method' => 'PUT', |
|
329 | - 'body' => array( |
|
325 | + { |
|
326 | + $response = Route4Me::makeRequst(array( |
|
327 | + 'url' => self::$apiMemberConfig, |
|
328 | + 'method' => 'PUT', |
|
329 | + 'body' => array( |
|
330 | 330 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
331 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
331 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
332 | 332 | ) |
333 | 333 | )); |
334 | 334 | return $response; |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | public $config_key; |
65 | 65 | public $config_value; |
66 | 66 | |
67 | - public function __construct () { } |
|
67 | + public function __construct() { } |
|
68 | 68 | |
69 | 69 | public static function fromArray(array $params) { |
70 | - $member= new Member(); |
|
71 | - foreach($params as $key => $value) { |
|
70 | + $member = new Member(); |
|
71 | + foreach ($params as $key => $value) { |
|
72 | 72 | if (property_exists($member, $key)) { |
73 | 73 | $member->{$key} = $value; |
74 | 74 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | 'url' => self::$apiUrlDevice, |
120 | 120 | 'method' => 'POST', |
121 | 121 | 'body' => array( |
122 | - 'device_id' => isset($body->device_id) ? $body->device_id: null, |
|
122 | + 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
123 | 123 | 'device_type' => isset($body->device_type) ? $body->device_type : null, |
124 | 124 | 'format' => isset($body->format) ? $body->format : null |
125 | 125 | ) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'url' => self::$apiUrl, |
135 | 135 | 'method' => 'POST', |
136 | 136 | 'body' => array( |
137 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
137 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null, |
|
138 | 138 | 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
139 | 139 | 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
140 | 140 | 'route_count' => isset($body->route_count) ? $body->route_count : null, |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | 'url' => self::$apiUrl, |
161 | 161 | 'method' => 'PUT', |
162 | 162 | 'body' => array( |
163 | - 'member_id' => isset($body->member_id) ? $body->member_id: null, |
|
163 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
164 | 164 | 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
165 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
165 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null, |
|
166 | 166 | 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
167 | 167 | 'route_count' => isset($body->route_count) ? $body->route_count : null, |
168 | 168 | 'member_email' => isset($body->member_email) ? $body->member_email : null, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | 'url' => self::$apiUrl, |
188 | 188 | 'method' => 'DELETE', |
189 | 189 | 'body' => array( |
190 | - 'member_id' => isset($body->member_id) ? $body->member_id: null |
|
190 | + 'member_id' => isset($body->member_id) ? $body->member_id : null |
|
191 | 191 | ) |
192 | 192 | |
193 | 193 | )); |
@@ -200,17 +200,17 @@ discard block |
||
200 | 200 | 'url' => self::$apiUrlRegistr, |
201 | 201 | 'method' => 'POST', |
202 | 202 | 'body' => array( |
203 | - 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
|
203 | + 'strEmail' => isset($body->strEmail) ? $body->strEmail : null, |
|
204 | 204 | 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
205 | 205 | 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
206 | - 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | - 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | - 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | - 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | - 'plan' => isset($body->plan) ? $body->plan: null, |
|
211 | - 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType: null, |
|
212 | - 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing: false, |
|
213 | - 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail: false |
|
206 | + 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName : null, |
|
207 | + 'strLastName' => isset($body->strLastName) ? $body->strLastName : null, |
|
208 | + 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry : null, |
|
209 | + 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms : null, |
|
210 | + 'plan' => isset($body->plan) ? $body->plan : null, |
|
211 | + 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType : null, |
|
212 | + 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing : false, |
|
213 | + 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail : false |
|
214 | 214 | ) |
215 | 215 | )); |
216 | 216 | return $response; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | 'url' => self::$apiUrlSessValid, |
223 | 223 | 'method' => 'GET', |
224 | 224 | 'query' => array( |
225 | - 'session_guid' => isset($params->session_guid) ? $params->session_guid: null, |
|
225 | + 'session_guid' => isset($params->session_guid) ? $params->session_guid : null, |
|
226 | 226 | 'member_id' => isset($params->member_id) ? $params->member_id : null, |
227 | 227 | 'format' => isset($params->format) ? $params->format : null |
228 | 228 | ) |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | 'url' => self::$apiUrlAuthen, |
237 | 237 | 'method' => 'POST', |
238 | 238 | 'body' => array( |
239 | - 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
|
239 | + 'strEmail' => isset($body->strEmail) ? $body->strEmail : null, |
|
240 | 240 | 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
241 | 241 | 'format' => isset($body->format) ? $body->format : null |
242 | 242 | ) |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | 'url' => self::$apiUrlWebinar, |
252 | 252 | 'method' => 'POST', |
253 | 253 | 'body' => array( |
254 | - 'email_address' => isset($body->email_address) ? $body->email_address: null, |
|
254 | + 'email_address' => isset($body->email_address) ? $body->email_address : null, |
|
255 | 255 | 'first_name' => isset($body->first_name) ? $body->first_name : null, |
256 | 256 | 'last_name' => isset($body->last_name) ? $body->last_name : null, |
257 | 257 | 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | 'url' => self::$apiUrlLicense, |
271 | 271 | 'method' => 'POST', |
272 | 272 | 'body' => array( |
273 | - 'member_id' => isset($body->member_id) ? $body->member_id: null, |
|
273 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
274 | 274 | 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
275 | 275 | 'device_id' => isset($body->device_id) ? $body->device_id : null, |
276 | 276 | 'device_type' => isset($body->device_type) ? $body->device_type : null, |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | 'url' => self::$apiMemberConfig, |
291 | 291 | 'method' => 'POST', |
292 | 292 | 'body' => array( |
293 | - 'config_key' => isset($body->config_key) ? $body->config_key: null, |
|
293 | + 'config_key' => isset($body->config_key) ? $body->config_key : null, |
|
294 | 294 | 'config_value' => isset($body->config_value) ? $body->config_value : null |
295 | 295 | ) |
296 | 296 | )); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | 'url' => self::$apiMemberConfig, |
304 | 304 | 'method' => 'DELETE', |
305 | 305 | 'body' => array( |
306 | - 'config_key' => isset($body->config_key) ? $body->config_key: null |
|
306 | + 'config_key' => isset($body->config_key) ? $body->config_key : null |
|
307 | 307 | ) |
308 | 308 | )); |
309 | 309 | return $response; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | 'url' => self::$apiMemberConfig, |
316 | 316 | 'method' => 'GET', |
317 | 317 | 'query' => array( |
318 | - 'config_key' => isset($body->config_key) ? $body->config_key: null |
|
318 | + 'config_key' => isset($body->config_key) ? $body->config_key : null |
|
319 | 319 | ) |
320 | 320 | )); |
321 | 321 | return $response; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | 'url' => self::$apiMemberConfig, |
328 | 328 | 'method' => 'PUT', |
329 | 329 | 'body' => array( |
330 | - 'config_key' => isset($body->config_key) ? $body->config_key: null, |
|
330 | + 'config_key' => isset($body->config_key) ? $body->config_key : null, |
|
331 | 331 | 'config_value' => isset($body->config_value) ? $body->config_value : null |
332 | 332 | ) |
333 | 333 | )); |