X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Fcommand%2Fclass_BaseCommandResolver.php;h=8b2258b44a498eece3d70e567305ed9ac9a0bf2e;hb=e7040f10e90178e789f97ef7e195b479250e241a;hp=4900c617a5336fb822077017559a89b36a792290;hpb=c6d73b0e3246efc824cb98338d4be7ee5bc9f308;p=core.git diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index 4900c617..8b2258b4 100644 --- a/inc/classes/main/resolver/command/class_BaseCommandResolver.php +++ b/inc/classes/main/resolver/command/class_BaseCommandResolver.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -22,15 +22,10 @@ * along with this program. If not, see . */ class BaseCommandResolver extends BaseResolver { - /** - * Prefix for local, remote or other resolver - */ - private $commandPrefix = ""; - /** * Validated command name */ - private $commandName = ""; + private $commandName = ''; /** * Protected constructor @@ -43,16 +38,6 @@ class BaseCommandResolver extends BaseResolver { parent::__construct($className); } - /** - * Setter for command prefix - * - * @param $commandPrefix Last validated commandPrefix - * @return void - */ - protected final function setCommandPrefix ($commandPrefix) { - $this->commandPrefix = $commandPrefix; - } - /** * Setter for command name * @@ -73,10 +58,10 @@ class BaseCommandResolver extends BaseResolver { } /** - * Checks wether the given command is valid + * Checks whether the given command is valid * * @param $commandName The default command we shall execute - * @return $isValid Wether the given command is valid + * @return $isValid Whether the given command is valid * @throws EmptyVariableException Thrown if given command is not set */ public function isCommandValid ($commandName) { @@ -87,13 +72,13 @@ class BaseCommandResolver extends BaseResolver { if (empty($commandName)) { // Then thrown an exception here throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } + } // END - if + + // Create the full class name + $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command'; // Now, let us create the full name of the command class - $this->setClassName(sprintf("%s%sCommand", - $this->commandPrefix, - $this->convertToClassName($commandName) - )); + $this->setClassName($className); // Is this class already loaded? if (class_exists($this->getClassName())) {