{
AbstractForm::save();
+ $overrideKey = \sprintf(
+ "%s\0upgradeOverride_%s",
+ PackageUpdateServer::class,
+ WCF::AVAILABLE_UPGRADE_VERSION,
+ );
+
$formData = $this->form->getData();
if ($formData['data']['enable']) {
$this->isEnabled = true;
- RegistryHandler::getInstance()->set('com.woltlab.wcf', PackageUpdateServer::class . "\0upgradeOverride", \TIME_NOW);
+ RegistryHandler::getInstance()->set('com.woltlab.wcf', $overrideKey, \TIME_NOW);
} else {
$this->isEnabled = false;
- RegistryHandler::getInstance()->delete('com.woltlab.wcf', PackageUpdateServer::class . "\0upgradeOverride");
+ RegistryHandler::getInstance()->delete('com.woltlab.wcf', $overrideKey);
}
+ // Clear the legacy override.
+ RegistryHandler::getInstance()->delete('com.woltlab.wcf', PackageUpdateServer::class . "\0upgradeOverride");
+
PackageUpdateServer::resetAll();
$this->form->cleanup();
return false;
}
- $override = RegistryHandler::getInstance()->get('com.woltlab.wcf', self::class . "\0upgradeOverride");
+ $overrideKey = \sprintf(
+ "%s\0upgradeOverride_%s",
+ self::class,
+ WCF::AVAILABLE_UPGRADE_VERSION,
+ );
+ $override = RegistryHandler::getInstance()->get('com.woltlab.wcf', $overrideKey);
if (!$override) {
return false;
}
if ($override < TIME_NOW - 86400) {
- RegistryHandler::getInstance()->delete('com.woltlab.wcf', self::class . "\0upgradeOverride");
+ RegistryHandler::getInstance()->delete('com.woltlab.wcf', $overrideKey);
// Clear package list cache to actually stop the upgrade from happening.
self::resetAll();