@@ 83-89 (lines=7) @@ | ||
80 | //echo "code = $code <br>"; |
|
81 | $json = json_decode($result, true); |
|
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 | } |
|
90 | } |
|
91 | ||
92 | public static function makeRequst($options) { |
|
@@ 198-204 (lines=7) @@ | ||
195 | $json = $jxml; |
|
196 | } else $json = json_decode($result, true); |
|
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 | } |
|
206 | ||
207 | public static function makeUrlRequst($url, $options) { |
|
@@ 284-290 (lines=7) @@ | ||
281 | } else $json = json_decode($result, true); |
|
282 | ||
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 | } |
|
291 | } |
|
292 | ||
293 | /** |