From 2af603c8e5ce928dcabed1a97a5a1fca3a4d1b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 24 Mar 2012 22:37:47 +0100 Subject: [PATCH] system.chat.commands -> system.chat.command --- file/lib/form/ChatForm.class.php | 8 ++++---- .../AbstractCommand.class.php | 4 ++-- .../AbstractRestrictedCommand.class.php | 4 ++-- .../CommandHandler.class.php | 6 +++--- .../{commands => command}/ICommand.class.php | 0 .../IRestrictedCommand.class.php | 0 .../NotFoundException.class.php | 0 .../UserNotFoundException.class.php | 0 .../commands/Away.class.php | 16 ++++++++-------- .../commands/Color.class.php | 18 +++++++++--------- .../commands/Free.class.php | 12 ++++++------ .../commands/Info.class.php | 18 +++++++++--------- .../commands/Me.class.php | 14 +++++++------- .../commands/Plain.class.php | 14 +++++++------- 14 files changed, 57 insertions(+), 57 deletions(-) rename file/lib/system/chat/{commands => command}/AbstractCommand.class.php (91%) rename file/lib/system/chat/{commands => command}/AbstractRestrictedCommand.class.php (90%) rename file/lib/system/chat/{commands => command}/CommandHandler.class.php (91%) rename file/lib/system/chat/{commands => command}/ICommand.class.php (100%) rename file/lib/system/chat/{commands => command}/IRestrictedCommand.class.php (100%) rename file/lib/system/chat/{commands => command}/NotFoundException.class.php (100%) rename file/lib/system/chat/{commands => command}/UserNotFoundException.class.php (100%) rename file/lib/system/chat/{commands => command}/commands/Away.class.php (60%) rename file/lib/system/chat/{commands => command}/commands/Color.class.php (79%) rename file/lib/system/chat/{commands => command}/commands/Free.class.php (61%) rename file/lib/system/chat/{commands => command}/commands/Info.class.php (71%) rename file/lib/system/chat/{commands => command}/commands/Me.class.php (58%) rename file/lib/system/chat/{commands => command}/commands/Plain.class.php (59%) diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index cedde00..3165528 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -74,23 +74,23 @@ public function save() { parent::save(); \wcf\util\ChatUtil::writeUserData(array('away' => null)); - $commandHandler = new \wcf\system\chat\commands\CommandHandler($this->message); + $commandHandler = new \wcf\system\chat\command\CommandHandler($this->message); if ($commandHandler->isCommand()) { try { $command = $commandHandler->loadCommand(); - if ($command->enableSmilies != \wcf\system\chat\commands\ICommand::SMILEY_USER) $this->enableSmilies = $command->enableSmilies; + if ($command->enableSmilies != \wcf\system\chat\command\ICommand::SMILEY_USER) $this->enableSmilies = $command->enableSmilies; $this->enableHTML = $command->enableHTML; $type = $command->getType(); $this->message = $command->getMessage(); $receiver = $command->getReceiver(); } - catch (\wcf\system\chat\commands\NotFoundException $e) { + catch (\wcf\system\chat\command\NotFoundException $e) { $this->message = WCF::getLanguage()->get('wcf.chat.command.error.notFound'); $type = chat\message\ChatMessage::TYPE_ERROR; $receiver = WCF::getUser()->userID; } - catch (\wcf\system\chat\commands\UserNotFoundException $e) { + catch (\wcf\system\chat\command\UserNotFoundException $e) { $this->message = WCF::getLanguage()->get('wcf.chat.command.error.userNotFound'); $type = chat\message\ChatMessage::TYPE_ERROR; $receiver = WCF::getUser()->userID; diff --git a/file/lib/system/chat/commands/AbstractCommand.class.php b/file/lib/system/chat/command/AbstractCommand.class.php similarity index 91% rename from file/lib/system/chat/commands/AbstractCommand.class.php rename to file/lib/system/chat/command/AbstractCommand.class.php index b5e0427..eda5c2b 100644 --- a/file/lib/system/chat/commands/AbstractCommand.class.php +++ b/file/lib/system/chat/command/AbstractCommand.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands + * @subpackage system.chat.command */ abstract class AbstractCommand implements ICommand { public $commandHandler = null; diff --git a/file/lib/system/chat/commands/AbstractRestrictedCommand.class.php b/file/lib/system/chat/command/AbstractRestrictedCommand.class.php similarity index 90% rename from file/lib/system/chat/commands/AbstractRestrictedCommand.class.php rename to file/lib/system/chat/command/AbstractRestrictedCommand.class.php index 6d743a0..fdbfce8 100644 --- a/file/lib/system/chat/commands/AbstractRestrictedCommand.class.php +++ b/file/lib/system/chat/command/AbstractRestrictedCommand.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands + * @subpackage system.chat.command */ abstract class AbstractRestrictedCommand extends AbstractCommand implements IRestrictedCommand { public function __construct(CommandHandler $commandHandler) { diff --git a/file/lib/system/chat/commands/CommandHandler.class.php b/file/lib/system/chat/command/CommandHandler.class.php similarity index 91% rename from file/lib/system/chat/commands/CommandHandler.class.php rename to file/lib/system/chat/command/CommandHandler.class.php index 23335fa..4dda64a 100644 --- a/file/lib/system/chat/commands/CommandHandler.class.php +++ b/file/lib/system/chat/command/CommandHandler.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands + * @subpackage system.chat.command */ final class CommandHandler { const COMMAND_CHAR = '/'; @@ -63,7 +63,7 @@ public function loadCommand() { return new commands\Plain($this); } - $class = '\wcf\system\chat\commands\commands\\'.ucfirst($parts[0]); + $class = '\wcf\system\chat\command\commands\\'.ucfirst($parts[0]); if (!class_exists($class)) { throw new NotFoundException(); } diff --git a/file/lib/system/chat/commands/ICommand.class.php b/file/lib/system/chat/command/ICommand.class.php similarity index 100% rename from file/lib/system/chat/commands/ICommand.class.php rename to file/lib/system/chat/command/ICommand.class.php diff --git a/file/lib/system/chat/commands/IRestrictedCommand.class.php b/file/lib/system/chat/command/IRestrictedCommand.class.php similarity index 100% rename from file/lib/system/chat/commands/IRestrictedCommand.class.php rename to file/lib/system/chat/command/IRestrictedCommand.class.php diff --git a/file/lib/system/chat/commands/NotFoundException.class.php b/file/lib/system/chat/command/NotFoundException.class.php similarity index 100% rename from file/lib/system/chat/commands/NotFoundException.class.php rename to file/lib/system/chat/command/NotFoundException.class.php diff --git a/file/lib/system/chat/commands/UserNotFoundException.class.php b/file/lib/system/chat/command/UserNotFoundException.class.php similarity index 100% rename from file/lib/system/chat/commands/UserNotFoundException.class.php rename to file/lib/system/chat/command/UserNotFoundException.class.php diff --git a/file/lib/system/chat/commands/commands/Away.class.php b/file/lib/system/chat/command/commands/Away.class.php similarity index 60% rename from file/lib/system/chat/commands/commands/Away.class.php rename to file/lib/system/chat/command/commands/Away.class.php index f9c994d..183e1f3 100644 --- a/file/lib/system/chat/commands/commands/Away.class.php +++ b/file/lib/system/chat/command/commands/Away.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ -class Away extends \wcf\system\chat\commands\AbstractCommand { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_OFF; +class Away extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; - public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) { + public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); \wcf\util\ChatUtil::writeUserData(array('away' => $commandHandler->getParameters())); @@ -22,21 +22,21 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan } /** - * @see \wcf\system\chat\commands\ICommand::getType() + * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_AWAY; } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { return $this->commandHandler->getParameters(); } /** - * @see \wcf\system\chat\commands\ICommand::getReceiver() + * @see \wcf\system\chat\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/commands/commands/Color.class.php b/file/lib/system/chat/command/commands/Color.class.php similarity index 79% rename from file/lib/system/chat/commands/commands/Color.class.php rename to file/lib/system/chat/command/commands/Color.class.php index 5514276..98f7231 100644 --- a/file/lib/system/chat/commands/commands/Color.class.php +++ b/file/lib/system/chat/command/commands/Color.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ -class Color extends \wcf\system\chat\commands\AbstractCommand { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_OFF; +class Color extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; public static $colors = array( 'red' => 0xFF0000, 'blue' => 0x0000FF, @@ -37,7 +37,7 @@ class Color extends \wcf\system\chat\commands\AbstractCommand { 'oxford' => 0xF02D // looks like green ); - public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) { + public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); try { list($color[1], $color[2]) = explode(' ', $commandHandler->getParameters()); @@ -50,7 +50,7 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan foreach ($color as $key => $val) { if (isset(self::$colors[$val])) $color[$key] = self::$colors[$val]; else { - if (!$regex->match($val)) throw new \wcf\system\chat\commands\NotFoundException(); + if (!$regex->match($val)) throw new \wcf\system\chat\command\NotFoundException(); $matches = $regex->getMatches(); $val = $matches[1]; if (strlen($val) == 3) $val = $val[0].$val[0].$val[1].$val[1].$val[2].$val[2]; @@ -62,21 +62,21 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan } /** - * @see \wcf\system\chat\commands\ICommand::getType() + * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { return 'color changed'; } /** - * @see \wcf\system\chat\commands\ICommand::getReceiver() + * @see \wcf\system\chat\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/commands/commands/Free.class.php b/file/lib/system/chat/command/commands/Free.class.php similarity index 61% rename from file/lib/system/chat/commands/commands/Free.class.php rename to file/lib/system/chat/command/commands/Free.class.php index a640a2f..7aead95 100644 --- a/file/lib/system/chat/commands/commands/Free.class.php +++ b/file/lib/system/chat/command/commands/Free.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ class Free extends Me { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_OFF; + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; - public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) { + public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); if (\wcf\util\StringUtil::toLowerCase($this->commandHandler->getParameters()) != 'the fish') { - throw new \wcf\system\chat\commands\NotFoundException(); + throw new \wcf\system\chat\command\NotFoundException(); } $this->didInit(); } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { return 'freed the fish. OH A NOEZ'; diff --git a/file/lib/system/chat/commands/commands/Info.class.php b/file/lib/system/chat/command/commands/Info.class.php similarity index 71% rename from file/lib/system/chat/commands/commands/Info.class.php rename to file/lib/system/chat/command/commands/Info.class.php index 09143a9..236da42 100644 --- a/file/lib/system/chat/commands/commands/Info.class.php +++ b/file/lib/system/chat/command/commands/Info.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ -class Info extends \wcf\system\chat\commands\AbstractCommand { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_OFF; +class Info extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; public $enableHTML = 1; private $lines = array(); - public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) { + public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); $user = \wcf\data\user\User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); - if (!$user->userID) throw new \wcf\system\chat\commands\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); + if (!$user->userID) throw new \wcf\system\chat\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); $room = new \wcf\data\chat\room\ChatRoom(ChatUtil::readUserData('roomID', $user)); $color = ChatUtil::readUserData('color', $user); @@ -38,14 +38,14 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan } /** - * @see \wcf\system\chat\commands\ICommand::getType() + * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { $lines = array(); @@ -56,7 +56,7 @@ public function getMessage() { } /** - * @see \wcf\system\chat\commands\ICommand::getReceiver() + * @see \wcf\system\chat\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/commands/commands/Me.class.php b/file/lib/system/chat/command/commands/Me.class.php similarity index 58% rename from file/lib/system/chat/commands/commands/Me.class.php rename to file/lib/system/chat/command/commands/Me.class.php index 64bcdff..3dba88c 100644 --- a/file/lib/system/chat/commands/commands/Me.class.php +++ b/file/lib/system/chat/command/commands/Me.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ -class Me extends \wcf\system\chat\commands\AbstractCommand { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_USER; +class Me extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER; - public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) { + public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); $this->didInit(); } /** - * @see \wcf\system\chat\commands\ICommand::getType() + * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_ME; } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { return $this->commandHandler->getParameters(); diff --git a/file/lib/system/chat/commands/commands/Plain.class.php b/file/lib/system/chat/command/commands/Plain.class.php similarity index 59% rename from file/lib/system/chat/commands/commands/Plain.class.php rename to file/lib/system/chat/command/commands/Plain.class.php index e0d9e53..99ed7ab 100644 --- a/file/lib/system/chat/commands/commands/Plain.class.php +++ b/file/lib/system/chat/command/commands/Plain.class.php @@ -1,5 +1,5 @@ * @package timwolla.wcf.chat - * @subpackage system.chat.commands.commands + * @subpackage system.chat.command.commands */ -class Plain extends \wcf\system\chat\commands\AbstractCommand { - public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_USER; +class Plain extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER; /** - * @see \wcf\system\chat\commands\ICommand::getType() + * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_NORMAL; } /** - * @see \wcf\system\chat\commands\ICommand::getMessage() + * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { return \wcf\util\StringUtil::substring($this->commandHandler->getText(), 1); } /** - * @see \wcf\system\chat\commands\ICommand::getReceiver() + * @see \wcf\system\chat\command\ICommand::getReceiver() */ public function getReceiver() { return null;