| @@ -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 ['error' => 'Invalid Product']; | 
| 129 | 129 | if ($product == 'LSWS' && !in_array($cpu, $this->validCpu)) | 
| @@ -137,9 +137,9 @@ discard block | ||
| 137 | 137 | $this->params['order_cpu'] = $cpu; | 
| 138 | 138 | $this->params['order_period'] = $period; | 
| 139 | 139 | $this->params['order_payment'] = $payment; | 
| 140 | - if ($cvv !== FALSE) | |
| 140 | + if ($cvv !== false) | |
| 141 | 141 | $this->params['order_cvv'] = $cvv; | 
| 142 | - if ($promocode !== FALSE) | |
| 142 | + if ($promocode !== false) | |
| 143 | 143 | $this->params['order_promocode'] = $promocode; | 
| 144 | 144 |  		return $this->req('Order'); | 
| 145 | 145 | } | 
| @@ -151,7 +151,7 @@ discard block | ||
| 151 | 151 | * @param bool $reason | 
| 152 | 152 | * @return mixed | 
| 153 | 153 | */ | 
| 154 | -	public function cancel($serial = FALSE, $ipAddress = FALSE, $now = 'Y', $reason = FALSE) { | |
| 154 | +	public function cancel($serial = false, $ipAddress = false, $now = 'Y', $reason = false) { | |
| 155 | 155 | $this->params['license_serial'] = $serial; | 
| 156 | 156 | $this->params['server_ip'] = $ipAddress; | 
| 157 | 157 | $this->params['cancel_now'] = $now; | 
| @@ -184,12 +184,12 @@ discard block | ||
| 184 | 184 | * @param mixed $reason optional reason for suspend/unsuspend | 
| 185 | 185 | * @return mixed | 
| 186 | 186 | */ | 
| 187 | -	public function suspend($serial = FALSE, $ipAddress = FALSE, $reason = FALSE) { | |
| 188 | - if ($serial !== FALSE) | |
| 187 | +	public function suspend($serial = false, $ipAddress = false, $reason = false) { | |
| 188 | + if ($serial !== false) | |
| 189 | 189 | $this->params['license_serial'] = $serial; | 
| 190 | - if ($ipAddress !== FALSE) | |
| 190 | + if ($ipAddress !== false) | |
| 191 | 191 | $this->params['server_ip'] = $ipAddress; | 
| 192 | - if ($reason !== FALSE) | |
| 192 | + if ($reason !== false) | |
| 193 | 193 | $this->params['reason'] = $reason; | 
| 194 | 194 |  		return $this->req('Suspend'); | 
| 195 | 195 | } | 
| @@ -202,12 +202,12 @@ discard block | ||
| 202 | 202 | * @param mixed $reason optional reason for suspend/unsuspend | 
| 203 | 203 | * @return mixed | 
| 204 | 204 | */ | 
| 205 | -	public function unsuspend($serial = FALSE, $ipAddress = FALSE, $reason = FALSE) { | |
| 206 | - if ($serial !== FALSE) | |
| 205 | +	public function unsuspend($serial = false, $ipAddress = false, $reason = false) { | |
| 206 | + if ($serial !== false) | |
| 207 | 207 | $this->params['license_serial'] = $serial; | 
| 208 | - if ($ipAddress !== FALSE) | |
| 208 | + if ($ipAddress !== false) | |
| 209 | 209 | $this->params['server_ip'] = $ipAddress; | 
| 210 | - if ($reason !== FALSE) | |
| 210 | + if ($reason !== false) | |
| 211 | 211 | $this->params['reason'] = $reason; | 
| 212 | 212 |  		return $this->req('Unsuspend'); | 
| 213 | 213 | } | 
| @@ -220,10 +220,10 @@ discard block | ||
| 220 | 220 | * @param bool $cvv | 
| 221 | 221 | * @return array|mixed | 
| 222 | 222 | */ | 
| 223 | -	public function upgrade($serial = FALSE, $ipAddress = FALSE, $cpu, $payment = 'credit', $cvv = FALSE) { | |
| 224 | - if ($serial !== FALSE) | |
| 223 | +	public function upgrade($serial = false, $ipAddress = false, $cpu, $payment = 'credit', $cvv = false) { | |
| 224 | + if ($serial !== false) | |
| 225 | 225 | $this->params['license_serial'] = $serial; | 
| 226 | - if ($ipAddress !== FALSE) | |
| 226 | + if ($ipAddress !== false) | |
| 227 | 227 | $this->params['server_ip'] = $ipAddress; | 
| 228 | 228 | if (!in_array($cpu, $this->validCpu)) | 
| 229 | 229 | return ['error' => 'Invalid CPU']; | 
| @@ -231,7 +231,7 @@ discard block | ||
| 231 | 231 | return ['error' => 'Invalid Payment Method']; | 
| 232 | 232 | $this->params['upgrade_cpu'] = $cpu; | 
| 233 | 233 | $this->params['order_payment'] = $payment; | 
| 234 | - if ($cvv !== FALSE) | |
| 234 | + if ($cvv !== false) | |
| 235 | 235 | $this->params['order_cvv'] = $cvv; | 
| 236 | 236 |  		return $this->req('Upgrade'); | 
| 237 | 237 | } | 
| @@ -267,7 +267,7 @@ discard block | ||
| 267 | 267 | * | 
| 268 | 268 | * @param mixed $post TRUE for POST , FALSE for GET requests * | 
| 269 | 269 | */ | 
| 270 | -	public function usePost($post = TRUE) { | |
| 270 | +	public function usePost($post = true) { | |
| 271 | 271 | $this->usePost = $post; | 
| 272 | 272 | } | 
| 273 | 273 | |
| @@ -282,15 +282,15 @@ discard block | ||
| 282 | 282 | // Set the curl parameters. | 
| 283 | 283 | $ch = curl_init(); | 
| 284 | 284 | $url = $this->url; | 
| 285 | -		if ($this->usePost !== FALSE) { | |
| 286 | - curl_setopt($ch, CURLOPT_POST, TRUE); | |
| 285 | +		if ($this->usePost !== false) { | |
| 286 | + curl_setopt($ch, CURLOPT_POST, true); | |
| 287 | 287 | $pstring = ''; | 
| 288 | 288 | foreach ($this->params as $param => $value) | 
| 289 | 289 | $pstring .= '&'.$param.'='.$value.''; | 
| 290 | 290 | $pstring = mb_substr($pstring, 1); | 
| 291 | 291 | curl_setopt($ch, CURLOPT_POSTFIELDS, $pstring); | 
| 292 | 292 |  		} else { | 
| 293 | - curl_setopt($ch, CURLOPT_POST, FALSE); | |
| 293 | + curl_setopt($ch, CURLOPT_POST, false); | |
| 294 | 294 | $pstring = ''; | 
| 295 | 295 | foreach ($this->params as $param => $value) | 
| 296 | 296 | $pstring .= '&'.$param.'='.$value.''; | 
| @@ -304,18 +304,18 @@ discard block | ||
| 304 | 304 | $this->rawResponse = curl_exec($ch); | 
| 305 | 305 |  		if (!$this->rawResponse) { | 
| 306 | 306 | $this->error[] = 'There was some error in connecting to Softaculous. This may be because of no internet connectivity at your end.'; | 
| 307 | - return FALSE; | |
| 307 | + return false; | |
| 308 | 308 | } | 
| 309 | 309 | |
| 310 | 310 | // Extract the response details. | 
| 311 | 311 | $this->response = xml2array($this->rawResponse); | 
| 312 | -		myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, TRUE), __LINE__, __FILE__); | |
| 312 | +		myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, true), __LINE__, __FILE__); | |
| 313 | 313 |  		if (empty($this->response['error'])) { | 
| 314 | 314 | unset($this->response['error']); | 
| 315 | 315 | return $this->response; | 
| 316 | 316 |  		} else { | 
| 317 | 317 | $this->error = array_merge($this->error, $this->response['error']); | 
| 318 | - return FALSE; | |
| 318 | + return false; | |
| 319 | 319 | } | 
| 320 | 320 | |
| 321 | 321 | } |