});
try {
- $licenseData = LicenseApi::readFromFile();
+ $licenseApi = new LicenseApi();
+ $licenseData = $licenseApi->readFromFile();
if ($licenseData !== null) {
$brandingFree = $licenseData->woltlab['com.woltlab.brandingFree'] ?? '0.0';
$expiresAt = $licenseData->license['expiryDates']['com.woltlab.brandingFree'] ?? \TIME_NOW;
*/
public function getCkeditorLicenseKey(): string
{
- $licenseData = LicenseApi::readFromFile();
+ $licenseApi = new LicenseApi();
+ $licenseData = $licenseApi->readFromFile();
+
if ($licenseData === null) {
return '';
}
return self::parseLicenseData($response->getBody());
}
- public static function readFromFile(): ?LicenseData
+ public function readFromFile(): ?LicenseData
{
- if (!\is_readable(self::LICENSE_FILE)) {
+ try {
+ return require(self::LICENSE_FILE);
+ } catch (\Throwable) {
+ $this->clearLicenseFile();
+
return null;
}
-
- return require(self::LICENSE_FILE);
}
public function clearLicenseFile(): void