From f70ff85e07d28061b31bf1f263df1d99e85b7dca Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 31 Jan 2026 15:15:53 +0100 Subject: [PATCH 1/3] Add a command for the update of `LAST_UPDATE_TIME` --- .../package/SetLastUpdateTIme.class.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 wcfsetup/install/files/lib/command/package/SetLastUpdateTIme.class.php 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(); + } +} From 4a018e5580e87e2c689ae6008763651f7f358433 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 31 Jan 2026 15:16:06 +0100 Subject: [PATCH 2/3] Make use of the new command --- .../plugin/PackageInstallationPluginAction.class.php | 11 ++--------- .../package/PackageInstallationDispatcher.class.php | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) 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 From c68a2b80c51eb5580b2c8342784b6c5bbb5666f0 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 31 Jan 2026 15:16:49 +0100 Subject: [PATCH 3/3] Update `LAST_UPDATE_TIME` after modifying a phrase Closes #5954 --- .../lib/command/language/preload/ResetPreloadCache.class.php | 3 +++ 1 file changed, 3 insertions(+) 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())(); } }