public function readLicenseInfo($license) { $license =
str_replace('-------- LICENSE BEGIN ---------', '',
$license);
$license =
str_replace('--------- LICENSE END ----------', '',
$license);
$license =
preg_replace('#--.+?--#', '',
(string) $license);
$license =
(string) preg_replace('#[^A-Za-z0-9+/=]#', '',
$license);
$info =
base64_decode($license, true
);
if ($info === false
) { throw new LicenseInvalidException('License key seems to be incorrect'
);
} $info = @
gzinflate($info);
if ($info === false
) { throw new LicenseInvalidException('License key seems to be incorrect'
);
} if (\
strlen($info) >
(512 + 60
) || \
strlen($info) < 100
) { throw new LicenseInvalidException('License key seems to be incorrect'
);
} $hash =
substr($info, 0, 20
);