1 | <?php |
||
10 | class Api |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $domain; |
||
16 | |||
17 | /** |
||
18 | * @param string $domain |
||
19 | */ |
||
20 | public function __construct($domain) |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | public function getDomain() |
||
32 | |||
33 | /** |
||
34 | * Read data from cauditor API. |
||
35 | * |
||
36 | * @param string $uri |
||
37 | * |
||
38 | * @return string|bool API response (on success) or false (on failure) |
||
39 | */ |
||
40 | public function get($uri) |
||
50 | |||
51 | /** |
||
52 | * Submit the data to cauditor API. |
||
53 | * |
||
54 | * @param string $uri |
||
55 | * @param array $data |
||
56 | * |
||
57 | * @return string|bool API response (on success) or false (on failure) |
||
58 | */ |
||
59 | public function put($uri, array $data) |
||
83 | |||
84 | /** |
||
85 | * @param array $options array of CURLOPT_* options |
||
86 | * |
||
87 | * @return string|bool API response (on success) or false (on failure) |
||
88 | */ |
||
89 | protected function exec($options) |
||
98 | } |
||
99 |