Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace wcf\command\language\preload;

use wcf\command\package\SetLastUpdateTime;
use wcf\data\language\Language;

/**
Expand All @@ -25,5 +26,7 @@ public function __invoke(): void
if (\file_exists($filename)) {
\unlink($filename);
}

(new SetLastUpdateTime())();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace wcf\command\package;

use wcf\data\option\OptionEditor;
use wcf\system\WCF;

/**
* Updates the `LAST_UPDATE_TIME` constant.
*
* @author Marcel Werk
* @copyright 2001-2026 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down