X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Fcommand%2Fclass_BaseCommandResolver.php;h=fa19bbb5e459c4b16ddea46ac6d4567c7326869d;hp=fc662c3aa1cb048a8ac7cc1ed72ba3edcdf10b36;hb=1d63a74abdafb0f8b6aabe727a37bddd1633300e;hpb=3107989f93cfb5808ce9d75f1c7d2b7ee3d83d18 diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index fc662c3a..fa19bbb5 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 - 2009 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -43,6 +43,15 @@ class BaseCommandResolver extends BaseResolver { parent::__construct($className); } + /** + * Getter for command prefix + * + * @return $commandPrefix Last validated commandPrefix + */ + protected final function getCommandPrefix () { + return $this->commandPrefix; + } + /** * Setter for command prefix * @@ -87,13 +96,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->commandPrefix . $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())) {