A lot rewrites and fixes for weak redirect methods
[shipsimu.git] / inc / classes / main / resolver / command / class_BaseCommandResolver.php
index 4ad1d3edf829de0d74aa762e0be913c445b48c2a..4900c617a5336fb822077017559a89b36a792290 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -32,11 +32,6 @@ class BaseCommandResolver extends BaseResolver {
         */
        private $commandName = "";
 
-       /**
-        * A controller instance
-        */
-       private $controllerInstance = null;
-
        /**
         * Protected constructor
         *
@@ -77,31 +72,12 @@ class BaseCommandResolver extends BaseResolver {
                return $this->commandName;
        }
 
-       /**
-        * Setter for controller instance (this surely breaks a bit the MVC patterm)
-        *
-        * @param       $controllerInstance             An instance of the controller
-        * @return      void
-        */
-       public final function setControllerInstance (Controller $controllerInstance) {
-               $this->controllerInstance = $controllerInstance;
-       }
-
-       /**
-        * Getter for controller instance (this surely breaks a bit the MVC patterm)
-        *
-        * @return      $controllerInstance             An instance of the controller
-        */
-       public final function getControllerInstance () {
-               return $this->controllerInstance;
-       }
-
        /**
         * Checks wether the given command is valid
         *
         * @param       $commandName    The default command we shall execute
         * @return      $isValid                Wether the given command is valid
-        * @throws      EmptyVariableException  Thrown if the given command is not set
+        * @throws      EmptyVariableException  Thrown if given command is not set
         */
        public function isCommandValid ($commandName) {
                // By default nothing shall be valid
@@ -114,20 +90,17 @@ class BaseCommandResolver extends BaseResolver {
                }
 
                // Now, let us create the full name of the command class
-               $className = sprintf("%s%sCommand",
+               $this->setClassName(sprintf("%s%sCommand",
                        $this->commandPrefix,
                        $this->convertToClassName($commandName)
-               );
+               ));
 
                // Is this class already loaded?
-               if (class_exists($className)) {
+               if (class_exists($this->getClassName())) {
                        // This class does exist. :-)
                        $isValid = true;
                } // END - if
 
-               // Debug output
-               //* DEBUG: */ $this->debugBacktrace();
-
                // Set command name
                $this->setCommandName($commandName);