1 | <?php |
||
12 | class Client implements QueryInterface |
||
13 | { |
||
14 | use HttpTrait; |
||
15 | |||
16 | /** |
||
17 | * Type of query |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $type = 'get'; |
||
22 | |||
23 | /** |
||
24 | * Endpoint of query |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $endpoint = []; |
||
29 | |||
30 | /** |
||
31 | * If auth is required |
||
32 | * |
||
33 | * @var bool |
||
34 | */ |
||
35 | protected $auth = false; |
||
36 | |||
37 | /** |
||
38 | * Parameters of query |
||
39 | * |
||
40 | * @var mixed |
||
41 | */ |
||
42 | protected $params; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | protected static $variables = []; |
||
48 | |||
49 | /** |
||
50 | * Client constructor. |
||
51 | * |
||
52 | * @param \PiHole\Config $config |
||
53 | */ |
||
54 | public function __construct(Config $config) |
||
62 | |||
63 | /** |
||
64 | * Get detailed statistic of system |
||
65 | * |
||
66 | * @return \PiHole\Interfaces\QueryInterface |
||
67 | */ |
||
68 | public function statistics(): QueryInterface |
||
72 | |||
73 | /** |
||
74 | * Get version of Pi Hole |
||
75 | * |
||
76 | * @return \PiHole\Interfaces\QueryInterface |
||
77 | * @link ?version |
||
78 | */ |
||
79 | public function version(): QueryInterface |
||
84 | |||
85 | /** |
||
86 | * Enable pihole (should be authorized) |
||
87 | * |
||
88 | * @return \PiHole\Interfaces\QueryInterface |
||
89 | * @link ?enable&auth=webpassword |
||
90 | */ |
||
91 | public function enable(): QueryInterface |
||
96 | |||
97 | /** |
||
98 | * Disable pihole (should be authorized) |
||
99 | * |
||
100 | * @return \PiHole\Interfaces\QueryInterface |
||
101 | * @link ?disable&auth=webpassword |
||
102 | */ |
||
103 | public function disable(): QueryInterface |
||
108 | |||
109 | /** |
||
110 | * Logout from pihole (should be authorized) |
||
111 | * |
||
112 | * @return \PiHole\Interfaces\QueryInterface |
||
113 | * @link ?logout&auth=webpassword |
||
114 | */ |
||
115 | public function logout(): QueryInterface |
||
120 | } |
||
121 |