@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public $login = ''; |
20 | 20 | public $password = ''; |
21 | - public $use_post = true; |
|
21 | + public $use_post = 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->valid_products)) { |
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, $ip = false, $now = 'Y', $reason = false) { |
|
161 | + public function cancel($serial = FALSE, $ip = FALSE, $now = 'Y', $reason = FALSE) { |
|
162 | 162 | $this->params['license_serial'] = $serial; |
163 | 163 | $this->params['server_ip'] = $ip; |
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, $ip = false, $reason = false) { |
|
195 | - if ($serial !== false) { |
|
194 | + public function suspend($serial = FALSE, $ip = FALSE, $reason = FALSE) { |
|
195 | + if ($serial !== FALSE) { |
|
196 | 196 | $this->params['license_serial'] = $serial; |
197 | 197 | } |
198 | - if ($ip !== false) { |
|
198 | + if ($ip !== FALSE) { |
|
199 | 199 | $this->params['server_ip'] = $ip; |
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, $ip = false, $reason = false) { |
|
216 | - if ($serial !== false) { |
|
215 | + public function unsuspend($serial = FALSE, $ip = FALSE, $reason = FALSE) { |
|
216 | + if ($serial !== FALSE) { |
|
217 | 217 | $this->params['license_serial'] = $serial; |
218 | 218 | } |
219 | - if ($ip !== false) { |
|
219 | + if ($ip !== FALSE) { |
|
220 | 220 | $this->params['server_ip'] = $ip; |
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, $ip = false, $cpu, $payment = 'credit', $cvv = false) { |
|
237 | - if ($serial !== false) { |
|
236 | + public function upgrade($serial = FALSE, $ip = FALSE, $cpu, $payment = 'credit', $cvv = FALSE) { |
|
237 | + if ($serial !== FALSE) { |
|
238 | 238 | $this->params['license_serial'] = $serial; |
239 | 239 | } |
240 | - if ($ip !== false) { |
|
240 | + if ($ip !== FALSE) { |
|
241 | 241 | $this->params['server_ip'] = $ip; |
242 | 242 | } |
243 | 243 | if (!in_array($cpu, $this->valid_cpu)) { |
@@ -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 use_post($post = true) { |
|
288 | + public function use_post($post = TRUE) { |
|
289 | 289 | $this->use_post = $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->use_post !== false) { |
|
304 | - curl_setopt($ch, CURLOPT_POST, true); |
|
303 | + if ($this->use_post !== 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.''; |
@@ -331,18 +331,18 @@ discard block |
||
331 | 331 | |
332 | 332 | if (!$this->rawResponse) { |
333 | 333 | $this->error[] = 'There was some error in connecting to Softaculous. This may be because of no internet connectivity at your end.'; |
334 | - return false; |
|
334 | + return FALSE; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Extract the response details. |
338 | 338 | $this->response = xml2array($this->rawResponse); |
339 | - myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, true), __LINE__, __FILE__); |
|
339 | + myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, TRUE), __LINE__, __FILE__); |
|
340 | 340 | if (empty($this->response['error'])) { |
341 | 341 | unset($this->response['error']); |
342 | 342 | return $this->response; |
343 | 343 | } else { |
344 | 344 | $this->error = array_merge($this->error, $this->response['error']); |
345 | - return false; |
|
345 | + return FALSE; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | } |