@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public $login = ''; |
| 20 | 20 | public $password = ''; |
| 21 | - public $usePost = true; |
|
| 21 | + public $usePost = TRUE; |
|
| 22 | 22 | public $url = 'https://store.litespeedtech.com/reseller/LiteSpeed_eService.php'; |
| 23 | 23 | public $version = '1.1'; |
| 24 | 24 | public $params = []; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * ), |
| 124 | 124 | * ) |
| 125 | 125 | */ |
| 126 | - public function order($product, $cpu = false, $period = 'monthly', $payment = 'credit', $cvv = false, $promocode = false) { |
|
| 126 | + public function order($product, $cpu = FALSE, $period = 'monthly', $payment = 'credit', $cvv = FALSE, $promocode = FALSE) { |
|
| 127 | 127 | if (!in_array($product, $this->validProducts)) { |
| 128 | 128 | return array('error' => 'Invalid Product'); |
| 129 | 129 | } |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | $this->params['order_period'] = $period; |
| 144 | 144 | $this->params['order_payment'] = $payment; |
| 145 | - if ($cvv !== false) { |
|
| 145 | + if ($cvv !== FALSE) { |
|
| 146 | 146 | $this->params['order_cvv'] = $cvv; |
| 147 | 147 | } |
| 148 | - if ($promocode !== false) { |
|
| 148 | + if ($promocode !== FALSE) { |
|
| 149 | 149 | $this->params['order_promocode'] = $promocode; |
| 150 | 150 | } |
| 151 | 151 | return $this->req('Order'); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @param bool $reason |
| 159 | 159 | * @return mixed |
| 160 | 160 | */ |
| 161 | - public function cancel($serial = false, $ipAddress = false, $now = 'Y', $reason = false) { |
|
| 161 | + public function cancel($serial = FALSE, $ipAddress = FALSE, $now = 'Y', $reason = FALSE) { |
|
| 162 | 162 | $this->params['license_serial'] = $serial; |
| 163 | 163 | $this->params['server_ip'] = $ipAddress; |
| 164 | 164 | $this->params['cancel_now'] = $now; |
@@ -191,14 +191,14 @@ discard block |
||
| 191 | 191 | * @param mixed $reason optional reason for suspend/unsuspend |
| 192 | 192 | * @return mixed |
| 193 | 193 | */ |
| 194 | - public function suspend($serial = false, $ipAddress = false, $reason = false) { |
|
| 195 | - if ($serial !== false) { |
|
| 194 | + public function suspend($serial = FALSE, $ipAddress = FALSE, $reason = FALSE) { |
|
| 195 | + if ($serial !== FALSE) { |
|
| 196 | 196 | $this->params['license_serial'] = $serial; |
| 197 | 197 | } |
| 198 | - if ($ipAddress !== false) { |
|
| 198 | + if ($ipAddress !== FALSE) { |
|
| 199 | 199 | $this->params['server_ip'] = $ipAddress; |
| 200 | 200 | } |
| 201 | - if ($reason !== false) { |
|
| 201 | + if ($reason !== FALSE) { |
|
| 202 | 202 | $this->params['reason'] = $reason; |
| 203 | 203 | } |
| 204 | 204 | return $this->req('Suspend'); |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | * @param mixed $reason optional reason for suspend/unsuspend |
| 213 | 213 | * @return mixed |
| 214 | 214 | */ |
| 215 | - public function unsuspend($serial = false, $ipAddress = false, $reason = false) { |
|
| 216 | - if ($serial !== false) { |
|
| 215 | + public function unsuspend($serial = FALSE, $ipAddress = FALSE, $reason = FALSE) { |
|
| 216 | + if ($serial !== FALSE) { |
|
| 217 | 217 | $this->params['license_serial'] = $serial; |
| 218 | 218 | } |
| 219 | - if ($ipAddress !== false) { |
|
| 219 | + if ($ipAddress !== FALSE) { |
|
| 220 | 220 | $this->params['server_ip'] = $ipAddress; |
| 221 | 221 | } |
| 222 | - if ($reason !== false) { |
|
| 222 | + if ($reason !== FALSE) { |
|
| 223 | 223 | $this->params['reason'] = $reason; |
| 224 | 224 | } |
| 225 | 225 | return $this->req('Unsuspend'); |
@@ -233,11 +233,11 @@ discard block |
||
| 233 | 233 | * @param bool $cvv |
| 234 | 234 | * @return array|mixed |
| 235 | 235 | */ |
| 236 | - public function upgrade($serial = false, $ipAddress = false, $cpu, $payment = 'credit', $cvv = false) { |
|
| 237 | - if ($serial !== false) { |
|
| 236 | + public function upgrade($serial = FALSE, $ipAddress = FALSE, $cpu, $payment = 'credit', $cvv = FALSE) { |
|
| 237 | + if ($serial !== FALSE) { |
|
| 238 | 238 | $this->params['license_serial'] = $serial; |
| 239 | 239 | } |
| 240 | - if ($ipAddress !== false) { |
|
| 240 | + if ($ipAddress !== FALSE) { |
|
| 241 | 241 | $this->params['server_ip'] = $ipAddress; |
| 242 | 242 | } |
| 243 | 243 | if (!in_array($cpu, $this->validCpu)) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | $this->params['upgrade_cpu'] = $cpu; |
| 250 | 250 | $this->params['order_payment'] = $payment; |
| 251 | - if ($cvv !== false) { |
|
| 251 | + if ($cvv !== FALSE) { |
|
| 252 | 252 | $this->params['order_cvv'] = $cvv; |
| 253 | 253 | } |
| 254 | 254 | return $this->req('Upgrade'); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * |
| 286 | 286 | * @param mixed $post TRUE for POST , FALSE for GET requests * |
| 287 | 287 | */ |
| 288 | - public function usePost($post = true) { |
|
| 288 | + public function usePost($post = TRUE) { |
|
| 289 | 289 | $this->usePost = $post; |
| 290 | 290 | } |
| 291 | 291 | |
@@ -300,8 +300,8 @@ discard block |
||
| 300 | 300 | // Set the curl parameters. |
| 301 | 301 | $ch = curl_init(); |
| 302 | 302 | $url = $this->url; |
| 303 | - if ($this->usePost !== false) { |
|
| 304 | - curl_setopt($ch, CURLOPT_POST, true); |
|
| 303 | + if ($this->usePost !== FALSE) { |
|
| 304 | + curl_setopt($ch, CURLOPT_POST, TRUE); |
|
| 305 | 305 | $pstring = ''; |
| 306 | 306 | foreach ($this->params as $param => $value) { |
| 307 | 307 | $pstring .= '&'.$param.'='.$value.''; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $pstring = mb_substr($pstring, 1); |
| 310 | 310 | curl_setopt($ch, CURLOPT_POSTFIELDS, $pstring); |
| 311 | 311 | } else { |
| 312 | - curl_setopt($ch, CURLOPT_POST, false); |
|
| 312 | + curl_setopt($ch, CURLOPT_POST, FALSE); |
|
| 313 | 313 | $pstring = ''; |
| 314 | 314 | foreach ($this->params as $param => $value) { |
| 315 | 315 | $pstring .= '&'.$param.'='.$value.''; |
@@ -324,18 +324,18 @@ discard block |
||
| 324 | 324 | $this->rawResponse = curl_exec($ch); |
| 325 | 325 | if (!$this->rawResponse) { |
| 326 | 326 | $this->error[] = 'There was some error in connecting to Softaculous. This may be because of no internet connectivity at your end.'; |
| 327 | - return false; |
|
| 327 | + return FALSE; |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | // Extract the response details. |
| 331 | 331 | $this->response = xml2array($this->rawResponse); |
| 332 | - myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, true), __LINE__, __FILE__); |
|
| 332 | + myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, TRUE), __LINE__, __FILE__); |
|
| 333 | 333 | if (empty($this->response['error'])) { |
| 334 | 334 | unset($this->response['error']); |
| 335 | 335 | return $this->response; |
| 336 | 336 | } else { |
| 337 | 337 | $this->error = array_merge($this->error, $this->response['error']); |
| 338 | - return false; |
|
| 338 | + return FALSE; |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | } |