|
28 | 28 | * |
29 | 29 | * @access public |
30 | 30 | */ |
31 | | -class Cloudlinux |
32 | | -{ |
| 31 | +class Cloudlinux { |
33 | 32 | private $login = ''; |
34 | 33 | private $key = ''; |
35 | 34 | public $prefix = 'registration.'; |
@@ -78,7 +77,7 @@ public function __construct($login, $key, $apiType = 'rest') { |
78 | 77 | */ |
79 | 78 | public function authToken() { |
80 | 79 | $time = time(); |
81 | | - return $this->login . '|' . $time . '|' . sha1($this->key . $time); |
| 80 | + return $this->login.'|'.$time.'|'.sha1($this->key.$time); |
82 | 81 | } |
83 | 82 |
|
84 | 83 | /** |
@@ -169,8 +168,8 @@ public function xmlIsLicensed($ipAddress, $checkAll = true) { |
169 | 168 | try { |
170 | 169 | return $this->response = $xmlClient->is_licensed($this->authToken(), $ipAddress, $checkAll); |
171 | 170 | } catch (\Exception $e) { |
172 | | - $this->log('error', 'Caught exception code: ' . $e->getCode()); |
173 | | - $this->log('error', 'Caught exception message: ' . $e->getMessage()); |
| 171 | + $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 172 | + $this->log('error', 'Caught exception message: '.$e->getMessage()); |
174 | 173 | return false; |
175 | 174 | } |
176 | 175 | } |
@@ -229,8 +228,8 @@ public function removeLicense($ipAddress, $type = 0) { |
229 | 228 | try { |
230 | 229 | return $this->response = $this->xmlClient->remove_license($this->authToken(), $ipAddress, $type); |
231 | 230 | } catch (\Exception $e) { |
232 | | - $this->log('error', 'Caught exception code: ' . $e->getCode()); |
233 | | - $this->log('error', 'Caught exception message: ' . $e->getMessage()); |
| 231 | + $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 232 | + $this->log('error', 'Caught exception message: '.$e->getMessage()); |
234 | 233 | return false; |
235 | 234 | } |
236 | 235 | } |
@@ -258,7 +257,7 @@ public function removeLicense($ipAddress, $type = 0) { |
258 | 257 | * @return false|array an array of licenses each one containing these fields: ip(string) ype(int) license type (1,2,16) registered(boolean) true if server was registered in CLN with this license (CLN licenses only). created(string) license creation time |
259 | 258 | */ |
260 | 259 | public function restList() { |
261 | | - $this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token=' . $this->authToken()); |
| 260 | + $this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token='.$this->authToken()); |
262 | 261 | return json_decode($this->response, true); |
263 | 262 | } |
264 | 263 |
|
@@ -294,14 +293,14 @@ public function licenseList() { |
294 | 293 | * @return false|integer 0 on success, -1 on error |
295 | 294 | */ |
296 | 295 | public function license($ipAddress, $type) { |
297 | | - $type = (int)$type; |
| 296 | + $type = (int) $type; |
298 | 297 | $xmlClient = $this->xmlClient; |
299 | 298 | try { |
300 | | - $this->log('error', 'Calling License(' . $this->authToken() . ',' . $ipAddress . ',' . $type . ')'); |
| 299 | + $this->log('error', 'Calling License('.$this->authToken().','.$ipAddress.','.$type.')'); |
301 | 300 | return $this->response = $xmlClient->license($this->authToken(), $ipAddress, $type); |
302 | 301 | } catch (\Exception $e) { |
303 | | - $this->log('error', 'Caught exception code: ' . $e->getCode()); |
304 | | - $this->log('error', 'Caught exception message: ' . $e->getMessage()); |
| 302 | + $this->log('error', 'Caught exception code: '.$e->getCode()); |
| 303 | + $this->log('error', 'Caught exception message: '.$e->getMessage()); |
305 | 304 | return false; |
306 | 305 | } |
307 | 306 | } |
|
0 commit comments