File tree Expand file tree Collapse file tree
wcfsetup/install/files/lib
data/package/installation/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace wcf \command \language \preload ;
44
5+ use wcf \command \package \SetLastUpdateTime ;
56use wcf \data \language \Language ;
67
78/**
@@ -25,5 +26,7 @@ public function __invoke(): void
2526 if (\file_exists ($ filename )) {
2627 \unlink ($ filename );
2728 }
29+
30+ (new SetLastUpdateTime ())();
2831 }
2932}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \command \package ;
4+
5+ use wcf \data \option \OptionEditor ;
6+ use wcf \system \WCF ;
7+
8+ /**
9+ * Updates the `LAST_UPDATE_TIME` constant.
10+ *
11+ * @author Marcel Werk
12+ * @copyright 2001-2026 WoltLab GmbH
13+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14+ * @since 6.2
15+ */
16+ final class SetLastUpdateTime
17+ {
18+ public function __construct (
19+ private readonly int $ time = \TIME_NOW
20+ ) {}
21+
22+ public function __invoke (): void
23+ {
24+ $ sql = "UPDATE wcf1_option
25+ SET optionValue = ?
26+ WHERE optionName = ? " ;
27+ $ statement = WCF ::getDB ()->prepare ($ sql );
28+ $ statement ->execute ([
29+ $ this ->time ,
30+ 'last_update_time ' ,
31+ ]);
32+
33+ OptionEditor::resetCache ();
34+ }
35+ }
Original file line number Diff line number Diff line change 22
33namespace wcf \data \package \installation \plugin ;
44
5+ use wcf \command \package \SetLastUpdateTime ;
56use wcf \data \AbstractDatabaseObjectAction ;
67use wcf \data \devtools \project \DevtoolsProject ;
78use wcf \data \option \OptionEditor ;
@@ -132,15 +133,7 @@ public function invoke()
132133 case 'file ' :
133134 StyleHandler::resetStylesheets (false );
134135
135- $ sql = "UPDATE wcf1_option
136- SET optionValue = ?
137- WHERE optionName = ? " ;
138- $ statement = WCF ::getDB ()->prepare ($ sql );
139- $ statement ->execute ([
140- \TIME_NOW ,
141- 'last_update_time ' ,
142- ]);
143- OptionEditor::resetCache ();
136+ (new SetLastUpdateTime ())();
144137 break ;
145138
146139 case 'language ' :
Original file line number Diff line number Diff line change 1616use wcf \event \package \PackageListChanged ;
1717use wcf \system \application \ApplicationHandler ;
1818use wcf \command \cache \ClearCache ;
19+ use wcf \command \package \SetLastUpdateTime ;
1920use wcf \system \database \statement \PreparedStatement ;
2021use wcf \system \devtools \DevtoolsSetup ;
2122use wcf \system \Environment ;
@@ -174,15 +175,7 @@ public function install(string $node): PackageInstallationStep
174175
175176 $ this ->logInstallationStep ([], 'start cleanup ' );
176177
177- // update "last update time" option
178- $ sql = "UPDATE wcf1_option
179- SET optionValue = ?
180- WHERE optionName = ? " ;
181- $ statement = WCF ::getDB ()->prepare ($ sql );
182- $ statement ->execute ([
183- TIME_NOW ,
184- 'last_update_time ' ,
185- ]);
178+ (new SetLastUpdateTime ())();
186179
187180 if ($ this ->action == 'install ' ) {
188181 // save localized package infos
You can’t perform that action at this time.
0 commit comments