@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public $prefix = 'registration.'; |
33 | 33 | public $encoding = 'utf-8'; // utf-8 / UTF-8 |
34 | 34 | public $apiType = 'rest'; |
35 | - public $sslverify = FALSE; |
|
35 | + public $sslverify = false; |
|
36 | 36 | public $xmlOptions = []; |
37 | 37 | public $xmlUrl = 'https://cln.cloudlinux.com/clweb/xmlrpc'; |
38 | 38 | public $restUrl = 'https://cln.cloudlinux.com/api/'; |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | $this->login = $login; |
56 | 56 | $this->key = $key; |
57 | 57 | $this->apiType = $apiType; |
58 | - $limitType = FALSE; |
|
59 | - if ($limitType === FALSE || $this->apiType == 'xml') { |
|
58 | + $limitType = false; |
|
59 | + if ($limitType === false || $this->apiType == 'xml') { |
|
60 | 60 | include_once 'XML/RPC2/Client.php'; |
61 | 61 | $this->xmlOptions['prefix'] = $this->prefix; |
62 | 62 | $this->xmlOptions['encoding'] = $this->encoding; |
63 | 63 | $this->xmlOptions['sslverify'] = $this->sslverify; |
64 | 64 | $this->xmlClient = \XML_RPC2_Client::create($this->xmlUrl, $this->xmlOptions); |
65 | 65 | } |
66 | - if ($limitType === FALSE || $this->apiType == 'rest') |
|
66 | + if ($limitType === false || $this->apiType == 'rest') |
|
67 | 67 | $this->restOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslverify; |
68 | 68 | } |
69 | 69 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function status() { |
118 | 118 | $this->response = $this->getcurlpage($this->restUrl.'status.json'); |
119 | - return json_decode($this->response, TRUE); |
|
119 | + return json_decode($this->response, true); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function availability($ipAddress) { |
128 | 128 | $this->response = $this->getcurlpage($this->restUrl.'ipl/availability.json?ip='.$ipAddress.'&token='.$this->authToken()); |
129 | - return json_decode($this->response, TRUE); |
|
129 | + return json_decode($this->response, true); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @throws XmlRpcException for critical errors |
138 | 138 | * @return FALSE|array (list<int>): List of registered license types or empty list if no license found |
139 | 139 | */ |
140 | - public function isLicensed($ipAddress, $checkAll = TRUE) { |
|
140 | + public function isLicensed($ipAddress, $checkAll = true) { |
|
141 | 141 | if ($this->apiType == 'xml') |
142 | 142 | return $this->xmlIsLicensed($ipAddress, $checkAll); |
143 | 143 | else |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function check($ipAddress) { |
154 | 154 | $this->response = $this->getcurlpage($this->restUrl.'ipl/check.json?ip='.$ipAddress.'&token='.$this->authToken()); |
155 | - $response = json_decode($this->response, TRUE); |
|
155 | + $response = json_decode($this->response, true); |
|
156 | 156 | if ($response['success'] == 1) |
157 | 157 | return $response['data']; |
158 | 158 | else |
159 | - return FALSE; |
|
159 | + return false; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | * @param bool $checkAll True will search for any type of license. False only for types 1 or 2 |
168 | 168 | * @return FALSE|array (list<int>): List of registered license types or empty list if no license found |
169 | 169 | */ |
170 | - public function xmlIsLicensed($ipAddress, $checkAll = TRUE) { |
|
170 | + public function xmlIsLicensed($ipAddress, $checkAll = true) { |
|
171 | 171 | $xmlClient = $this->xmlClient; |
172 | 172 | try { |
173 | 173 | return $this->response = $xmlClient->is_licensed($this->authToken(), $ipAddress, $checkAll); |
174 | 174 | } catch (\Exception $e) { |
175 | 175 | $this->log('error', 'Caught exception code: '.$e->getCode(), __LINE__, __FILE__); |
176 | 176 | $this->log('error', 'Caught exception message: '.$e->getMessage(), __LINE__, __FILE__); |
177 | - return FALSE; |
|
177 | + return false; |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $this->response = $this->getcurlpage($this->restUrl.'ipl/remove.json?ip='.$ipAddress.'&type='.$type.'&token='.$this->authToken()); |
205 | 205 | else |
206 | 206 | $this->response = $this->getcurlpage($this->restUrl.'ipl/remove.json?ip='.$ipAddress.'&token='.$this->authToken()); |
207 | - return json_decode($this->response, TRUE); |
|
207 | + return json_decode($this->response, true); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } catch (\Exception $e) { |
223 | 223 | $this->log('error', 'Caught exception code: '.$e->getCode(), __LINE__, __FILE__); |
224 | 224 | $this->log('error', 'Caught exception message: '.$e->getMessage(), __LINE__, __FILE__); |
225 | - return FALSE; |
|
225 | + return false; |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public function restList() { |
265 | 265 | $this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token='.$this->authToken()); |
266 | - return json_decode($this->response, TRUE); |
|
266 | + return json_decode($this->response, true); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function register($ipAddress, $type) { |
299 | 299 | $this->response = $this->getcurlpage($this->restUrl.'ipl/register.json?ip='.$ipAddress.'&type='.$type.'&token='.$this->authToken()); |
300 | - $return = json_decode($this->response, TRUE); |
|
300 | + $return = json_decode($this->response, true); |
|
301 | 301 | return isset($return['registered']) ? $return['registered'] : $return; |
302 | 302 | } |
303 | 303 | |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | } catch (\Exception $e) { |
319 | 319 | $this->log('error', 'Caught exception code: '.$e->getCode(), __LINE__, __FILE__); |
320 | 320 | $this->log('error', 'Caught exception message: '.$e->getMessage(), __LINE__, __FILE__); |
321 | - return FALSE; |
|
321 | + return false; |
|
322 | 322 | } |
323 | 323 | if ($this->response == -1) |
324 | - return FALSE; |
|
324 | + return false; |
|
325 | 325 | elseif ($this->response == 0) |
326 | - return TRUE; |
|
326 | + return true; |
|
327 | 327 | else |
328 | 328 | return $this->response; |
329 | 329 | } |