use wcf\system\exception\NamedUserException;
use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
+use wcf\system\package\license\LicenseApi;
use wcf\system\package\PackageInstallationScheduler;
use wcf\system\package\PackageUpdateDispatcher;
use wcf\system\package\PackageUpdateUnauthorizedException;
{
PackageUpdateDispatcher::getInstance()->refreshPackageDatabase([], $this->parameters['ignoreCache']);
+ // Try to update the cached license data to check for recent purchases.
+ if (LicenseApi::hasLicenseCredentials()) {
+ $licenseApi = LicenseApi::fetchFromRemote();
+ $licenseApi->updateLicenseFile();
+ }
+
$updates = PackageUpdateDispatcher::getInstance()->getAvailableUpdates();
$url = '';
if (!empty($updates)) {
use wcf\data\cronjob\Cronjob;
use wcf\system\language\LanguageFactory;
+use wcf\system\package\license\LicenseApi;
use wcf\system\package\PackageUpdateDispatcher;
use wcf\system\WCF;
WCF::setLanguage($currentLanguage);
}
}
+
+ $this->refreshLicenseFile();
+ }
+
+ /**
+ * Refresh the license file to update any recently made purchases.
+ */
+ private function refreshLicenseFile(): void
+ {
+ try {
+ $licenseApi = LicenseApi::fetchFromRemote();
+ $licenseApi->updateLicenseFile();
+ } catch (\Throwable) {
+ // This is a “silent” operation that should not interrupt the
+ // execution of cronjobs in case of an error.
+ }
}
}