Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f3a0328
Move commands added in 6.2 to `lib/command`
BurntimeX Oct 7, 2025
e10462d
--Duplicate ConfigureBoxes.class.php history into ../../../../command…
BurntimeX Oct 7, 2025
a90a0de
--Restore ConfigureBoxes.class.php
BurntimeX Oct 7, 2025
4536f12
Move `ConfigureBoxes` command
BurntimeX Oct 7, 2025
a2a085e
--Duplicate CreateBoxCondition.class.php history into ../../../comman…
BurntimeX Oct 7, 2025
f9b9f1d
--Restore CreateBoxCondition.class.php
BurntimeX Oct 7, 2025
e9bdfdb
Move `CreateBoxCondition` command
BurntimeX Oct 7, 2025
5962e2f
--Duplicate CreateBoxToPageAssignments.class.php history into ../../.…
BurntimeX Oct 7, 2025
b1fd4f3
--Restore CreateBoxToPageAssignments.class.php
BurntimeX Oct 7, 2025
90303a5
Move `CreateBoxToPageAssignments` command
BurntimeX Oct 7, 2025
de5a87e
--Duplicate ClearCache.class.php history into ../../../command/cache/…
BurntimeX Oct 7, 2025
8cc540d
--Restore ClearCache.class.php
BurntimeX Oct 7, 2025
47a9581
Move `ClearCache` command
BurntimeX Oct 7, 2025
c900ec6
--Duplicate CreateComment.class.php history into ../../../command/com…
BurntimeX Oct 7, 2025
9dc48df
--Restore CreateComment.class.php
BurntimeX Oct 7, 2025
ef0267c
Move `CreateComment` command
BurntimeX Oct 7, 2025
2a64e51
--Duplicate PublishComment.class.php history into ../../../command/co…
BurntimeX Oct 7, 2025
f43e8c3
--Restore PublishComment.class.php
BurntimeX Oct 7, 2025
a3ae8eb
Move `PublishComment` command
BurntimeX Oct 7, 2025
88e3d4f
--Duplicate DeleteComments.class.php history into ../../../command/co…
BurntimeX Oct 7, 2025
0fa01a5
--Restore DeleteComments.class.php
BurntimeX Oct 7, 2025
4f14d00
Move `DeleteComments` command
BurntimeX Oct 7, 2025
3ec2de4
--Duplicate UpdateComment.class.php history into ../../../command/com…
BurntimeX Oct 7, 2025
7303cd4
--Restore UpdateComment.class.php
BurntimeX Oct 7, 2025
4dac8ec
Move `UpdateComment` command
BurntimeX Oct 7, 2025
0a14ed4
--Duplicate PublishResponse.class.php history into ../../../../comman…
BurntimeX Oct 7, 2025
cb39620
--Restore PublishResponse.class.php
BurntimeX Oct 7, 2025
b3cb9f0
Move `PublishResponse` command
BurntimeX Oct 7, 2025
867ba1d
--Duplicate CreateResponse.class.php history into ../../../../command…
BurntimeX Oct 8, 2025
301696c
--Restore CreateResponse.class.php
BurntimeX Oct 8, 2025
407bfeb
Move `CreateResponse` command
BurntimeX Oct 8, 2025
e6b7c44
--Duplicate DeleteResponses.class.php history into ../../../../comman…
BurntimeX Oct 8, 2025
5e9ec7b
--Restore DeleteResponses.class.php
BurntimeX Oct 8, 2025
e2e5291
Move `DeleteResponses` command
BurntimeX Oct 8, 2025
3fd455b
--Duplicate UpdateResponse.class.php history into ../../../../command…
BurntimeX Oct 8, 2025
a971d52
--Restore UpdateResponse.class.php
BurntimeX Oct 8, 2025
5251d65
Move `UpdateResponse` command
BurntimeX Oct 8, 2025
bc42b8d
--Duplicate ReplaceFileSource.class.php history into ../../../command…
BurntimeX Oct 8, 2025
65112e0
--Restore ReplaceFileSource.class.php
BurntimeX Oct 8, 2025
ec0ae59
--Duplicate CachePreloadPhrases.class.php history into ../../../../co…
BurntimeX Oct 8, 2025
e46eaa8
--Restore CachePreloadPhrases.class.php
BurntimeX Oct 8, 2025
87c3fbd
Move `ReplaceFileSource` command
BurntimeX Oct 8, 2025
0e2d136
Move `CachePreloadPhrases` command
BurntimeX Oct 8, 2025
627bed0
--Duplicate ResetPreloadCache.class.php history into ../../../../comm…
BurntimeX Oct 8, 2025
f09ce25
--Restore ResetPreloadCache.class.php
BurntimeX Oct 8, 2025
e276f78
Move `ResetPreloadCache` command
BurntimeX Oct 8, 2025
f2c40ce
--Duplicate AssignUser.class.php history into ../../../../command/mod…
BurntimeX Oct 8, 2025
2dbb1ce
--Restore AssignUser.class.php
BurntimeX Oct 8, 2025
1b93130
Move `AssignUser` command
BurntimeX Oct 8, 2025
8687f71
--Duplicate RebuildBootstrapper.class.php history into ../../../comma…
BurntimeX Oct 8, 2025
090dd4d
--Restore RebuildBootstrapper.class.php
BurntimeX Oct 8, 2025
b7bdc22
Move `RebuildBootstrapper` command
BurntimeX Oct 8, 2025
e01d00d
--Duplicate AddDarkMode.class.php history into ../../../command/style…
BurntimeX Oct 8, 2025
cac764a
--Restore AddDarkMode.class.php
BurntimeX Oct 8, 2025
cfc025b
Move `AddDarkMode` command
BurntimeX Oct 8, 2025
9649cdd
--Duplicate CreateManifest.class.php history into ../../../command/st…
BurntimeX Oct 8, 2025
2d90cb6
--Restore CreateManifest.class.php
BurntimeX Oct 8, 2025
c98d87e
Move `CreateManifest` command
BurntimeX Oct 8, 2025
d8eec71
--Duplicate CreateRegistrationNotification.class.php history into ../…
BurntimeX Oct 8, 2025
51ec5ae
--Restore CreateRegistrationNotification.class.php
BurntimeX Oct 8, 2025
7d3f6f8
Move `CreateRegistrationNotification` command
BurntimeX Oct 8, 2025
1dc6e22
--Duplicate Follow.class.php history into ../../../command/user/Follo…
BurntimeX Oct 8, 2025
fe69732
--Restore Follow.class.php
BurntimeX Oct 8, 2025
a53e755
Move `Follow` command
BurntimeX Oct 8, 2025
c25b789
--Duplicate SetColorScheme.class.php history into ../../../command/us…
BurntimeX Oct 8, 2025
a8361c8
--Restore SetColorScheme.class.php
BurntimeX Oct 8, 2025
cd5750b
Move `SetColorScheme` command
BurntimeX Oct 8, 2025
a862cbf
--Duplicate Unfollow.class.php history into ../../../command/user/Unf…
BurntimeX Oct 8, 2025
844698d
--Restore Unfollow.class.php
BurntimeX Oct 8, 2025
e2c0657
Move `Unfollow` command
BurntimeX Oct 8, 2025
141016c
Move `CopyUserGroup` command
BurntimeX Oct 8, 2025
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 @@ -7,7 +7,7 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use wcf\system\cache\command\ClearCache;
use wcf\command\cache\ClearCache;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\WCF;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use wcf\system\acp\dashboard\AcpDashboard;
use wcf\system\acp\dashboard\command\ConfigureBoxes;
use wcf\command\acp\dashboard\ConfigureBoxes;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\form\builder\field\MultipleSelectionFormField;
use wcf\system\form\builder\Psr15DialogForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use wcf\http\Helper;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\style\command\AddDarkMode;
use wcf\system\WCF;

/**
Expand Down Expand Up @@ -51,7 +50,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
if ($request->getMethod() === 'GET') {
return new TextResponse('Unsupported', 400);
} elseif ($request->getMethod() === 'POST') {
$command = new AddDarkMode($style);
$command = new \wcf\command\style\AddDarkMode($style);
$command();

return new EmptyResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use wcf\system\form\builder\container\FormContainer;
use wcf\system\form\builder\field\RadioButtonFormField;
use wcf\system\form\builder\Psr15DialogForm;
use wcf\system\tagging\command\SetSynonym;
use wcf\command\tag\SetTagSynonym;
use wcf\system\WCF;

/**
Expand Down Expand Up @@ -70,7 +70,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
}

$tagID = $form->getData()["data"]["tagID"];
(new SetSynonym(
(new SetTagSynonym(
$tagList->search($tagID),
$tagList->getObjects()
))();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Psr\Http\Server\RequestHandlerInterface;
use wcf\data\article\Article;
use wcf\http\Helper;
use wcf\system\article\command\DisableI18n;
use wcf\system\article\command\EnableI18n;
use wcf\command\article\DisableI18n;
use wcf\command\article\EnableI18n;
use wcf\system\exception\IllegalLinkException;
use wcf\system\form\builder\field\RadioButtonFormField;
use wcf\system\form\builder\LanguageItemFormNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use wcf\system\form\builder\field\BooleanFormField;
use wcf\system\form\builder\Psr15DialogForm;
use wcf\system\request\LinkHandler;
use wcf\system\user\group\command\CopyUserGroup;
use wcf\command\user\group\CopyUserGroup;
use wcf\system\WCF;

/**
Expand Down
3 changes: 1 addition & 2 deletions wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
use wcf\system\html\upcast\HtmlUpcastProcessor;
use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
use wcf\system\moderation\queue\ModerationQueueManager;
use wcf\system\option\user\UserOptionHandler;
use wcf\system\style\StyleHandler;
use wcf\system\user\command\SetColorScheme;
use wcf\command\user\SetColorScheme;
use wcf\system\user\multifactor\Setup;
use wcf\system\WCF;
use wcf\util\StringUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use wcf\system\form\builder\field\validation\FormFieldValidationError;
use wcf\system\form\builder\field\validation\FormFieldValidator;
use wcf\system\form\builder\Psr15DialogForm;
use wcf\system\moderation\queue\command\AssignUser;
use wcf\command\moderation\queue\AssignUser;
use wcf\system\WCF;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use wcf\system\form\builder\field\RadioButtonFormField;
use wcf\system\form\builder\IFormDocument;
use wcf\system\form\builder\Psr15DialogForm;
use wcf\system\user\command\SetAvatar;
use wcf\command\user\SetAvatar;
use wcf\system\user\UserProfileHandler;
use wcf\system\WCF;
use wcf\util\HtmlString;
Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/lib/action/UserFollowAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use wcf\http\Helper;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\user\command\Follow;
use wcf\system\user\command\Unfollow;
use wcf\command\user\Follow;
use wcf\command\user\Unfollow;
use wcf\system\WCF;

/**
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/bootstrap/com.woltlab.wcf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use wcf\system\cronjob\CronjobScheduler;
use wcf\system\event\EventHandler;
use wcf\system\language\LanguageFactory;
use wcf\system\language\preload\command\ResetPreloadCache;
use wcf\command\language\preload\ResetPreloadCache;
use wcf\system\language\preload\PhrasePreloader;
use wcf\system\package\license\LicenseApi;
use wcf\system\user\authentication\LoginRedirect;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace wcf\command\acp\dashboard;

use wcf\data\user\User;
use wcf\system\acp\dashboard\AcpDashboard;
use wcf\system\WCF;

/**
* Saves the configuration of the acp dashboard boxes.
*
* @author Marcel Werk
* @copyright 2001-2023 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
final class ConfigureBoxes
{
/**
* @param string[] $boxes
*/
public function __construct(
private readonly AcpDashboard $dashboard,
private readonly User $user,
private readonly array $boxes,
) {}

public function __invoke(): void
{
$this->resetBoxes();
$this->saveBoxes();
}

private function resetBoxes(): void
{
$sql = "DELETE FROM wcf1_acp_dashboard_box_to_user WHERE userID = ?";
$statement = WCF::getDB()->prepare($sql);
$statement->execute([$this->user->userID]);
}

private function saveBoxes(): void
{
$sql = "INSERT INTO wcf1_acp_dashboard_box_to_user (boxName, userID, enabled, showOrder) VALUES (?, ?, ?, ?)";
$statement = WCF::getDB()->prepare($sql);
$showOrder = 0;
foreach ($this->boxes as $boxName) {
$statement->execute([
$boxName,
$this->user->userID,
1,
$showOrder++
]);
}

foreach ($this->dashboard->getBoxes() as $box) {
if (\in_array($box->getName(), $this->boxes)) {
continue;
}

$statement->execute([
$box->getName(),
$this->user->userID,
0,
0
]);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace wcf\system\article\command;
namespace wcf\command\article;

use wcf\data\article\Article;
use wcf\data\article\ArticleAction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace wcf\system\article\command;
namespace wcf\command\article;

use wcf\data\article\Article;
use wcf\data\article\ArticleAction;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

namespace wcf\command\box;

use wcf\data\box\Box;
use wcf\data\condition\ConditionAction;
use wcf\system\WCF;

/**
* Creates a new condition for an existing box.
*
* Note: The primary use of this command is to be used during package installation.
*
* @author Marcel Werk
* @copyright 2001-2024 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
final class CreateBoxCondition
{
/**
* @param mixed[] $conditionData
*/
public function __construct(
private readonly string $boxIdentifier,
private readonly string $conditionDefinition,
private readonly string $conditionObjectType,
private readonly array $conditionData
) {}

/**
* @throws \InvalidArgumentException
*/
public function __invoke(): void
{
$objectTypeID = $this->getObjectTypeID();
if (!$objectTypeID) {
throw new \InvalidArgumentException(
"Unknown box condition '{$this->conditionObjectType}' of condition definition '{$this->conditionDefinition}'"
);
}

$box = Box::getBoxByIdentifier($this->boxIdentifier);
if ($box === null) {
throw new \InvalidArgumentException("Unknown box with identifier '{$this->boxIdentifier}'");
}

(new ConditionAction([], 'create', [
'data' => [
'conditionData' => \serialize($this->conditionData),
'objectID' => $box->boxID,
'objectTypeID' => $objectTypeID,
],
]))->executeAction();
}

private function getObjectTypeID(): ?int
{
// do not rely on caches during package installation
$sql = "SELECT objectTypeID
FROM wcf1_object_type object_type
INNER JOIN wcf1_object_type_definition object_type_definition
ON object_type.definitionID = object_type_definition.definitionID
WHERE objectType = ?
AND definitionName = ?";
$statement = WCF::getDB()->prepare($sql);
$statement->execute([$this->conditionObjectType, $this->conditionDefinition]);

return $statement->fetchSingleColumn();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace wcf\command\box;

use wcf\data\box\Box;
use wcf\data\page\Page;
use wcf\system\WCF;

/**
* Assigns pages to a certain box.
*
* Note: The primary use of this command is to be used during package installation.
*
* @author Marcel Werk
* @copyright 2001-2024 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
final class CreateBoxToPageAssignments
{
/**
* @param string[] $pageIdentifiers
*/
public function __construct(
private readonly string $boxIdentifier,
private readonly array $pageIdentifiers,
private readonly bool $visible = true,
) {}

/**
* @throws \InvalidArgumentException
*/
public function __invoke(): void
{
$box = Box::getBoxByIdentifier($this->boxIdentifier);
if ($box === null) {
throw new \InvalidArgumentException("Unknown box with identifier '{$this->boxIdentifier}'");
}

$pages = [];
foreach ($this->pageIdentifiers as $pageIdentifier) {
$page = Page::getPageByIdentifier($pageIdentifier);
if ($page === null) {
throw new \InvalidArgumentException("Unknown page with identifier '{$pageIdentifier}'");
}
$pages[] = $page;
}

if (($this->visible && $box->visibleEverywhere) || (!$this->visible && !$box->visibleEverywhere)) {
$sql = "DELETE FROM wcf1_box_to_page
WHERE boxID = ?
AND pageID = ?";
$statement = WCF::getDB()->prepare($sql);
foreach ($pages as $page) {
$statement->execute([$box->boxID, $page->pageID]);
}
} else {
$sql = "REPLACE INTO wcf1_box_to_page
(boxID, pageID, visible)
VALUES (?, ?, ?)";
$statement = WCF::getDB()->prepare($sql);
foreach ($pages as $page) {
$statement->execute([$box->boxID, $page->pageID, $this->visible ? 1 : 0]);
}
}
}
}
42 changes: 42 additions & 0 deletions wcfsetup/install/files/lib/command/cache/ClearCache.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace wcf\command\cache;

use wcf\data\option\OptionEditor;
use wcf\data\package\update\server\PackageUpdateServer;
use wcf\event\cache\CacheCleared;
use wcf\system\cache\CacheHandler;
use wcf\system\event\EventHandler;
use wcf\system\language\LanguageFactory;
use wcf\system\style\StyleHandler;
use wcf\system\user\storage\UserStorageHandler;

/**
* Performs a full cache clear.
*
* @author Tim Duesterhus
* @copyright 2001-2021 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
final class ClearCache
{
public function __invoke(): void
{
OptionEditor::resetCache();

UserStorageHandler::getInstance()->clear();

StyleHandler::resetStylesheets();

LanguageFactory::getInstance()->deleteLanguageCache();

CacheHandler::getInstance()->flushAll();

PackageUpdateServer::resetAll();

EventHandler::getInstance()->fire(
new CacheCleared()
);
}
}
Loading
Loading