1 | <?php |
||
10 | class Api |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $api; |
||
16 | |||
17 | /** |
||
18 | * @param string $api |
||
19 | */ |
||
20 | public function __construct($api) |
||
24 | |||
25 | /** |
||
26 | * Read data from cauditor API. |
||
27 | * |
||
28 | * @param string $uri |
||
29 | * |
||
30 | * @return string|bool API response (on success) or false (on failure) |
||
31 | */ |
||
32 | public function get($uri) |
||
42 | |||
43 | /** |
||
44 | * Submit the data to cauditor API. |
||
45 | * |
||
46 | * @param string $uri |
||
47 | * @param array $data |
||
48 | * |
||
49 | * @return string|bool API response (on success) or false (on failure) |
||
50 | */ |
||
51 | public function put($uri, array $data) |
||
75 | |||
76 | /** |
||
77 | * @param array $options array of CURLOPT_* options |
||
78 | * |
||
79 | * @return string|bool API response (on success) or false (on failure) |
||
80 | */ |
||
81 | protected function exec($options) |
||
90 | } |
||
91 |