diff --git a/wcfsetup/install/files/lib/command/language/preload/ResetPreloadCache.class.php b/wcfsetup/install/files/lib/command/language/preload/ResetPreloadCache.class.php index 03abaef663..a50d05343d 100644 --- a/wcfsetup/install/files/lib/command/language/preload/ResetPreloadCache.class.php +++ b/wcfsetup/install/files/lib/command/language/preload/ResetPreloadCache.class.php @@ -2,6 +2,7 @@ namespace wcf\command\language\preload; +use wcf\command\package\SetLastUpdateTime; use wcf\data\language\Language; /** @@ -25,5 +26,7 @@ public function __invoke(): void if (\file_exists($filename)) { \unlink($filename); } + + (new SetLastUpdateTime())(); } } diff --git a/wcfsetup/install/files/lib/command/package/SetLastUpdateTIme.class.php b/wcfsetup/install/files/lib/command/package/SetLastUpdateTIme.class.php new file mode 100644 index 0000000000..7422f51399 --- /dev/null +++ b/wcfsetup/install/files/lib/command/package/SetLastUpdateTIme.class.php @@ -0,0 +1,35 @@ + + * @since 6.2 + */ +final class SetLastUpdateTime +{ + public function __construct( + private readonly int $time = \TIME_NOW + ) {} + + public function __invoke(): void + { + $sql = "UPDATE wcf1_option + SET optionValue = ? + WHERE optionName = ?"; + $statement = WCF::getDB()->prepare($sql); + $statement->execute([ + $this->time, + 'last_update_time', + ]); + + OptionEditor::resetCache(); + } +} diff --git a/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php b/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php index 6669d0b475..5f8cf707db 100644 --- a/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php @@ -2,6 +2,7 @@ namespace wcf\data\package\installation\plugin; +use wcf\command\package\SetLastUpdateTime; use wcf\data\AbstractDatabaseObjectAction; use wcf\data\devtools\project\DevtoolsProject; use wcf\data\option\OptionEditor; @@ -132,15 +133,7 @@ public function invoke() case 'file': StyleHandler::resetStylesheets(false); - $sql = "UPDATE wcf1_option - SET optionValue = ? - WHERE optionName = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([ - \TIME_NOW, - 'last_update_time', - ]); - OptionEditor::resetCache(); + (new SetLastUpdateTime())(); break; case 'language': diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index a0a0433ae5..9004d25ced 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -16,6 +16,7 @@ use wcf\event\package\PackageListChanged; use wcf\system\application\ApplicationHandler; use wcf\command\cache\ClearCache; +use wcf\command\package\SetLastUpdateTime; use wcf\system\database\statement\PreparedStatement; use wcf\system\devtools\DevtoolsSetup; use wcf\system\Environment; @@ -174,15 +175,7 @@ public function install(string $node): PackageInstallationStep $this->logInstallationStep([], 'start cleanup'); - // update "last update time" option - $sql = "UPDATE wcf1_option - SET optionValue = ? - WHERE optionName = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([ - TIME_NOW, - 'last_update_time', - ]); + (new SetLastUpdateTime())(); if ($this->action == 'install') { // save localized package infos