Issues (13)

bin/expire_license.php (3 issues)

Labels
Severity
1
<?php
2
include '../src/Cpanel.php';
3
$cpl = new \Detain\Cpanel\Cpanel($_SERVER['argv'][1], $_SERVER['argv'][2]);
4
5
$ipAddress = $_SERVER['argv'][3];
6
$cpl->format = 'json';
7
$lisc = json_decode($cpl->fetchLicenseId(['ip' => $ipAddress]), true);
8
print_r($lisc);
9
$liscid = $lisc['licenseid'][0];
10
11
if ($liscid > 0) {
12
	$expire = json_decode($cpl->expireLicense(
13
		[
14
			liscid => $liscid,
0 ignored issues
show
The constant liscid was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
15
			reason => 'Automagic Expiration',
0 ignored issues
show
The constant reason was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
16
			expcode => 'normal'
0 ignored issues
show
The constant expcode was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
17
		]
18
	), true);
19
	print $expire['result'].PHP_EOL;
20
} else {
21
	print "There is no valid license for $ipAddress\n";
22
}
23