/**
* A generic command resolver class
*
- * @author Roland Haeder <webmaster@ship-simu.org>
+ * @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
* @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
+ * @link http://www.shipsimu.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseCommandResolver extends BaseResolver {
- /**
- * Prefix for local, remote or other resolver
- */
- private $commandPrefix = '';
-
/**
* Validated command name
*/
parent::__construct($className);
}
- /**
- * Getter for command prefix
- *
- * @return $commandPrefix Last validated commandPrefix
- */
- protected final function getCommandPrefix () {
- return $this->commandPrefix;
- }
-
- /**
- * Setter for command prefix
- *
- * @param $commandPrefix Last validated commandPrefix
- * @return void
- */
- protected final function setCommandPrefix ($commandPrefix) {
- $this->commandPrefix = $commandPrefix;
- }
-
/**
* Setter for command name
*
}
/**
- * 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) {
// By default nothing shall be valid
- $isValid = false;
+ $isValid = FALSE;
// Is a command set?
if (empty($commandName)) {
} // END - if
// Create the full class name
- $className = $this->commandPrefix . $this->convertToClassName($commandName) . 'Command';
+ $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($commandName) . 'Command';
// Now, let us create the full name of the command class
$this->setClassName($className);
// Is this class already loaded?
if (class_exists($this->getClassName())) {
// This class does exist. :-)
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Set command name