@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public $prefix = 'registration.'; |
| 35 | 35 | public $encoding = 'utf-8'; // utf-8 / UTF-8 |
| 36 | 36 | public $apiType = 'rest'; |
| 37 | - public $sslverify = false; |
|
| 37 | + public $sslverify = FALSE; |
|
| 38 | 38 | public $xmlOptions = []; |
| 39 | 39 | public $xmlUrl = 'https://cln.cloudlinux.com/clweb/xmlrpc'; |
| 40 | 40 | public $restUrl = 'https://cln.cloudlinux.com/api/'; |
@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | $this->login = $login; |
| 58 | 58 | $this->key = $key; |
| 59 | 59 | $this->apiType = $apiType; |
| 60 | - $limitType = false; |
|
| 61 | - if ($limitType === false || $this->apiType == 'xml') { |
|
| 60 | + $limitType = FALSE; |
|
| 61 | + if ($limitType === FALSE || $this->apiType == 'xml') { |
|
| 62 | 62 | include_once('XML/RPC2/Client.php'); |
| 63 | 63 | $this->xmlOptions['prefix'] = $this->prefix; |
| 64 | 64 | $this->xmlOptions['encoding'] = $this->encoding; |
| 65 | 65 | $this->xmlOptions['sslverify'] = $this->sslverify; |
| 66 | 66 | $this->xmlClient = \XML_RPC2_Client::create($this->xmlUrl, $this->xmlOptions); |
| 67 | 67 | } |
| 68 | - if ($limitType === false || $this->apiType == 'rest') { |
|
| 68 | + if ($limitType === FALSE || $this->apiType == 'rest') { |
|
| 69 | 69 | $this->restOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslverify; |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function status() { |
| 115 | 115 | $this->response = $this->getcurlpage($this->restUrl.'status.json'); |
| 116 | - return json_decode($this->response, true); |
|
| 116 | + return json_decode($this->response, TRUE); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function availability($ipAddress) { |
| 125 | 125 | $this->response = $this->getcurlpage($this->restUrl.'ipl/availability.json?ip='.$ipAddress.'&token='.$this->authToken()); |
| 126 | - return json_decode($this->response, true); |
|
| 126 | + return json_decode($this->response, TRUE); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function check($ipAddress) { |
| 136 | 136 | $this->response = $this->getcurlpage($this->restUrl.'ipl/check.json?ip='.$ipAddress.'&token='.$this->authToken()); |
| 137 | - $response = json_decode($this->response, true); |
|
| 137 | + $response = json_decode($this->response, TRUE); |
|
| 138 | 138 | if ($response['success'] == 1) |
| 139 | 139 | return $response['data']; |
| 140 | 140 | else |
| 141 | - return false; |
|
| 141 | + return FALSE; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @throws XmlRpcException for critical errors |
| 150 | 150 | * @return false|array (list<int>): List of registered license types or empty list if no license found |
| 151 | 151 | */ |
| 152 | - public function isLicensed($ipAddress, $checkAll = true) { |
|
| 152 | + public function isLicensed($ipAddress, $checkAll = TRUE) { |
|
| 153 | 153 | if ($this->apiType == 'xml') |
| 154 | 154 | return $this->xmlIsLicensed($ipAddress, $checkAll); |
| 155 | 155 | else |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | * @param bool $checkAll True will search for any type of license. False only for types 1 or 2 |
| 164 | 164 | * @return false|array (list<int>): List of registered license types or empty list if no license found |
| 165 | 165 | */ |
| 166 | - public function xmlIsLicensed($ipAddress, $checkAll = true) { |
|
| 166 | + public function xmlIsLicensed($ipAddress, $checkAll = TRUE) { |
|
| 167 | 167 | $xmlClient = $this->xmlClient; |
| 168 | 168 | try { |
| 169 | 169 | return $this->response = $xmlClient->is_licensed($this->authToken(), $ipAddress, $checkAll); |
| 170 | 170 | } catch (\Exception $e) { |
| 171 | 171 | $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 172 | 172 | $this->log('error', 'Caught exception message: '.$e->getMessage()); |
| 173 | - return false; |
|
| 173 | + return FALSE; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function register($ipAddress, $type) { |
| 185 | 185 | $this->response = $this->getcurlpage($this->restUrl.'ipl/register.json?ip='.$ipAddress.'&type='.$type.'&token='.$this->authToken()); |
| 186 | - return json_decode($this->response, true); |
|
| 186 | + return json_decode($this->response, TRUE); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $this->response = $this->getcurlpage($this->restUrl.'ipl/remove.json?ip='.$ipAddress.'&type='.$type.'&token='.$this->authToken()); |
| 199 | 199 | else |
| 200 | 200 | $this->response = $this->getcurlpage($this->restUrl.'ipl/remove.json?ip='.$ipAddress.'&token='.$this->authToken()); |
| 201 | - return json_decode($this->response, true); |
|
| 201 | + return json_decode($this->response, TRUE); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } catch (\Exception $e) { |
| 231 | 231 | $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 232 | 232 | $this->log('error', 'Caught exception message: '.$e->getMessage()); |
| 233 | - return false; |
|
| 233 | + return FALSE; |
|
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function restList() { |
| 260 | 260 | $this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token='.$this->authToken()); |
| 261 | - return json_decode($this->response, true); |
|
| 261 | + return json_decode($this->response, TRUE); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | } catch (\Exception $e) { |
| 302 | 302 | $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 303 | 303 | $this->log('error', 'Caught exception message: '.$e->getMessage()); |
| 304 | - return false; |
|
| 304 | + return FALSE; |
|
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | } |