]> git.mxchange.org Git - shipsimu.git/commitdiff
Renamed more from 'web' to 'html'.
authorRoland Haeder <roland@mxchange.org>
Mon, 23 Mar 2015 16:04:30 +0000 (17:04 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 23 Mar 2015 16:04:30 +0000 (17:04 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
16 files changed:
application/shipsimu/main/controller/html/.htaccess [new file with mode: 0644]
application/shipsimu/main/controller/html/class_HtmlCompanyController.php [new file with mode: 0644]
application/shipsimu/main/controller/html/class_HtmlGovernmentFailedController.php [new file with mode: 0644]
application/shipsimu/main/controller/web/.htaccess [deleted file]
application/shipsimu/main/controller/web/class_WebCompanyController.php [deleted file]
application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php [deleted file]
application/shipsimu/main/resolver/command/.htaccess [new file with mode: 0644]
application/shipsimu/main/resolver/command/html/.htaccess [new file with mode: 0644]
application/shipsimu/main/resolver/command/html/class_HtmlCompanyCommandResolver.php [new file with mode: 0644]
application/shipsimu/main/resolver/command/html/class_HtmlGovernmentFailedCommandResolver.php [new file with mode: 0644]
application/shipsimu/main/resolver/controller/.htaccess [new file with mode: 0644]
application/shipsimu/main/resolver/controller/html/.htaccess [new file with mode: 0644]
application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php [new file with mode: 0644]
application/shipsimu/main/resolver/web/.htaccess [deleted file]
application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php [deleted file]
application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php [deleted file]

diff --git a/application/shipsimu/main/controller/html/.htaccess b/application/shipsimu/main/controller/html/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/main/controller/html/class_HtmlCompanyController.php b/application/shipsimu/main/controller/html/class_HtmlCompanyController.php
new file mode 100644 (file)
index 0000000..741cc5a
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Controller for company requests
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlCompanyController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public static final function createHtmlCompanyController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new HtmlCompanyController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // User auth filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // User update filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+
+               // News fetcher filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+
+               // News proccess/display-preparation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed');
+
+                       // Exit here
+                       exit();
+               }
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/main/controller/html/class_HtmlGovernmentFailedController.php b/application/shipsimu/main/controller/html/class_HtmlGovernmentFailedController.php
new file mode 100644 (file)
index 0000000..217b6b5
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Controller for failed government requests
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlGovernmentFailedController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public static final function createHtmlGovernmentFailedController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new HtmlGovernmentFailedController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // User auth filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // User update filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+
+               // News fetcher filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+
+               // News proccess/display-preparation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed');
+
+                       // Exit here
+                       exit();
+               }
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/main/controller/web/.htaccess b/application/shipsimu/main/controller/web/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/shipsimu/main/controller/web/class_WebCompanyController.php b/application/shipsimu/main/controller/web/class_WebCompanyController.php
deleted file mode 100644 (file)
index c5f1e2d..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
- * Controller for company requests
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class WebCompanyController extends BaseController implements Controller {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param       $resolverInstance               An instance of a command resolver class
-        * @return      $controllerInstance             A prepared instance of this class
-        * @todo        Add some filters to this controller
-        */
-       public static final function createWebCompanyController (CommandResolver $resolverInstance) {
-               // Create the instance
-               $controllerInstance = new WebCompanyController();
-
-               // Set the command resolver
-               $controllerInstance->setResolverInstance($resolverInstance);
-
-               // User auth filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
-
-               // User update filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
-
-               // News fetcher filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
-
-               // News proccess/display-preparation
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
-
-               // Return the prepared instance
-               return $controllerInstance;
-       }
-
-       /**
-        * Handles the given request and response
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @param       $responseInstance       An instance of a response class
-        * @return      void
-        */
-       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get the command instance from the resolver by sending a request instance to the resolver
-               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
-
-               // Add more filters by the command
-               $commandInstance->addExtraFilters($this, $requestInstance);
-
-               // Try to run the pre filters, if auth exceptions come through redirect here
-               try {
-                       // Run the pre filters
-                       $this->executePreFilters($requestInstance, $responseInstance);
-               } catch (UserAuthorizationException $e) {
-                       // Redirect to main page
-                       $responseInstance->redirectToConfiguredUrl('login_failed');
-
-                       // Exit here
-                       exit();
-               }
-
-               // This request was valid! :-D
-               $requestInstance->requestIsValid();
-
-               // Execute the command
-               $commandInstance->execute($requestInstance, $responseInstance);
-
-               // Run the pre filters
-               $this->executePostFilters($requestInstance, $responseInstance);
-
-               // Flush the response out
-               $responseInstance->flushBuffer();
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php b/application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php
deleted file mode 100644 (file)
index c51bf1c..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
- * Controller for failed government requests
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class WebGovernmentFailedController extends BaseController implements Controller {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param       $resolverInstance               An instance of a command resolver class
-        * @return      $controllerInstance             A prepared instance of this class
-        * @todo        Add some filters to this controller
-        */
-       public static final function createWebGovernmentFailedController (CommandResolver $resolverInstance) {
-               // Create the instance
-               $controllerInstance = new WebGovernmentFailedController();
-
-               // Set the command resolver
-               $controllerInstance->setResolverInstance($resolverInstance);
-
-               // User auth filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
-
-               // User update filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
-
-               // News fetcher filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
-
-               // News proccess/display-preparation
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
-
-               // Return the prepared instance
-               return $controllerInstance;
-       }
-
-       /**
-        * Handles the given request and response
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @param       $responseInstance       An instance of a response class
-        * @return      void
-        */
-       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get the command instance from the resolver by sending a request instance to the resolver
-               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
-
-               // Add more filters by the command
-               $commandInstance->addExtraFilters($this, $requestInstance);
-
-               // Try to run the pre filters, if auth exceptions come through redirect here
-               try {
-                       // Run the pre filters
-                       $this->executePreFilters($requestInstance, $responseInstance);
-               } catch (UserAuthorizationException $e) {
-                       // Redirect to main page
-                       $responseInstance->redirectToConfiguredUrl('login_failed');
-
-                       // Exit here
-                       exit();
-               }
-
-               // This request was valid! :-D
-               $requestInstance->requestIsValid();
-
-               // Execute the command
-               $commandInstance->execute($requestInstance, $responseInstance);
-
-               // Run the pre filters
-               $this->executePostFilters($requestInstance, $responseInstance);
-
-               // Flush the response out
-               $responseInstance->flushBuffer();
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/shipsimu/main/resolver/command/.htaccess b/application/shipsimu/main/resolver/command/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/main/resolver/command/html/.htaccess b/application/shipsimu/main/resolver/command/html/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/main/resolver/command/html/class_HtmlCompanyCommandResolver.php b/application/shipsimu/main/resolver/command/html/class_HtmlCompanyCommandResolver.php
new file mode 100644 (file)
index 0000000..e04768c
--- /dev/null
@@ -0,0 +1,190 @@
+<?php
+/**
+ * A command resolver for local (non-hubbed) web commands including the failed government request
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlCompanyCommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Last successfull resolved command
+        */
+       private $lastCommandInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Html"
+               $this->setCommandPrefix('Html');
+       }
+
+       /**
+        * Creates an instance of a Html command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidInterfaceException       Thrown if command does not implement interface Commandable
+        */
+       public static final function createHtmlCompanyCommandResolver ($commandName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new HtmlCompanyCommandResolver();
+
+               // Get request instance
+               $requestInstance = $appInstance->getRequestInstance();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) {
+                       // Invalid command found (missing interface?)
+                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an command instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        * @throws      InvalidCommandException                         Thrown if $commandName is
+        *                                                                                              invalid
+        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveCommandByRequest (Requestable $requestInstance) {
+               // Init instance
+               $commandInstance = null;
+
+               // This goes fine so let's resolv the command
+               $commandName = str_replace('-', '_', $requestInstance->getRequestElement('app')) . '_' . $requestInstance->getRequestElement('page');
+
+               // Is there a "failed" request?
+               if ($requestInstance->isRequestElementSet('failed')) {
+                       // Then include with within the command name
+                       $commandName = $commandName . '_' . $requestInstance->getRequestElement('failed');
+               } // END - if
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
+
+               // Return the resolved command instance
+               return $commandInstance;
+       }
+
+       /**
+        * Resolves the command by its direct name and returns an instance of its class
+        *
+        * @param       $commandName            The direct command name we shall resolve
+        * @return      $commandInstance        An instance of the command class
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        */
+       public function resolveCommand ($commandName) {
+               // Initiate the instance variable
+               $commandInstance = null;
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // Return the instance
+               return $commandInstance;
+       }
+
+       /**
+        * "Loads" a given command and instances it if not yet cached
+        *
+        * @param       $commandName                            A command name we shall look for
+        * @return      $commandInstance                        A loaded command instance
+        * @throws      InvalidCommandException         Thrown if even the default
+        *                                                                              command class is missing (bad!)
+        */
+       private function loadCommand ($commandName) {
+               // Cache default command
+               $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Init command instance
+               $commandInstance = null;
+
+               // Get 'app' from the application
+               $app = Registry::getRegistry()->getInstance('application')->getRequestInstance()->getRequestElement('app');
+
+               // Create command class name
+               $this->setClassName(sprintf('%s%sCommand',
+                       $this->getCommandPrefix(),
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so throw an exception
+                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Initiate the command
+               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $commandInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/main/resolver/command/html/class_HtmlGovernmentFailedCommandResolver.php b/application/shipsimu/main/resolver/command/html/class_HtmlGovernmentFailedCommandResolver.php
new file mode 100644 (file)
index 0000000..a83f222
--- /dev/null
@@ -0,0 +1,187 @@
+<?php
+/**
+ * A command resolver for local (non-hubbed) web commands including the failed government request
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlGovernmentFailedCommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Last successfull resolved command
+        */
+       private $lastCommandInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Html"
+               $this->setCommandPrefix('Html');
+       }
+
+       /**
+        * Creates an instance of a Html command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidInterfaceException       Thrown if command does not implement interface Commandable
+        */
+       public static final function createHtmlGovernmentFailedCommandResolver ($commandName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new HtmlGovernmentFailedCommandResolver();
+
+               // Get request instance
+               $requestInstance = $appInstance->getRequestInstance();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) {
+                       // Invalid command found (missing interface?)
+                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an command instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        * @throws      InvalidCommandException                         Thrown if $commandName is
+        *                                                                                              invalid
+        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveCommandByRequest (Requestable $requestInstance) {
+               // Init instance
+               $commandInstance = null;
+
+               // This goes fine so let's resolv the command
+               $commandName = $requestInstance->getRequestElement('page');
+
+               // Is there a "failed" request?
+               if ($requestInstance->isRequestElementSet('failed')) {
+                       // Then include with within the command name
+                       $commandName = sprintf('%s_%s', $commandName, $requestInstance->getRequestElement('failed'));
+               } // END - if
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
+
+               // Return the resolved command instance
+               return $commandInstance;
+       }
+
+       /**
+        * Resolves the command by its direct name and returns an instance of its class
+        *
+        * @param       $commandName            The direct command name we shall resolve
+        * @return      $commandInstance        An instance of the command class
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        */
+       public function resolveCommand ($commandName) {
+               // Initiate the instance variable
+               $commandInstance = null;
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // Return the instance
+               return $commandInstance;
+       }
+
+       /**
+        * "Loads" a given command and instances it if not yet cached
+        *
+        * @param       $commandName                            A command name we shall look for
+        * @return      $commandInstance                        A loaded command instance
+        * @throws      InvalidCommandException         Thrown if even the default
+        *                                                                              command class is missing (bad!)
+        */
+       private function loadCommand ($commandName) {
+               // Cache default command
+               $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
+
+               // Init command instance
+               $commandInstance = null;
+
+               // Create command class name
+               $this->setClassName(sprintf('%s%sCommand',
+                       $this->getCommandPrefix(),
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so throw an exception
+                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Initiate the command
+               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $commandInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/main/resolver/controller/.htaccess b/application/shipsimu/main/resolver/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/main/resolver/controller/html/.htaccess b/application/shipsimu/main/resolver/controller/html/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php b/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php
new file mode 100644 (file)
index 0000000..9f18f22
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/**
+ * A resolver for resolving controllers locally
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuHtmlControllerResolver extends BaseControllerResolver implements ControllerResolver {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to 'ShipSimuHtml'
+               $this->setClassPrefix('ShipSimuHtml');
+       }
+
+       /**
+        * Creates an instance of a resolver class with a given command
+        *
+        * @param       $controllerName                         The controller we shall resolve
+        * @param       $applicationInstance            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared controller resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
+        */
+       public static final function createShipSimuHtmlControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+               // Create the new instance
+               $resolverInstance = new ShipSimuHtmlControllerResolver();
+
+               // Is the variable $controllerName set and the command is valid?
+               if (empty($controllerName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
+                       // Invalid command found
+                       throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($applicationInstance);
+
+               // Set command name
+               $resolverInstance->setControllerName($controllerName);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Resolves the default controller of the given command
+        *
+        * @return      $controllerInstance             A controller instance for the default
+        *                                                                      command
+        * @throws      InvalidControllerInstanceException      Thrown if $controllerInstance
+        *                                                                                              is invalid
+        */
+       public function resolveController () {
+               // Init variables
+               $controllerName = '';
+               $controllerInstance = NULL;
+
+               // Get the command name 
+               $controllerName = $this->getControllerName();
+
+               // Get the command
+               $controllerInstance = $this->loadController($controllerName);
+
+               // And validate it
+               if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
+                       // This command has an invalid instance!
+                       throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Set last controller
+               $this->setResolvedInstance($controllerInstance);
+
+               // Return the maybe resolved instance
+               return $controllerInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/main/resolver/web/.htaccess b/application/shipsimu/main/resolver/web/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php b/application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php
deleted file mode 100644 (file)
index e5fcfb4..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-<?php
-/**
- * A command resolver for local (non-hubbed) web commands including the failed government request
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class WebCompanyCommandResolver extends BaseCommandResolver implements CommandResolver {
-       /**
-        * Last successfull resolved command
-        */
-       private $lastCommandInstance = null;
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set prefix to "Web"
-               $this->setCommandPrefix('Web');
-       }
-
-       /**
-        * Creates an instance of a Web command resolver with a given default command
-        *
-        * @param       $commandName                            The default command we shall execute
-        * @param       $appInstance                            An instance of a manageable application helper class
-        * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      EmptyVariableException          Thrown if default command is not set
-        * @throws      InvalidInterfaceException       Thrown if command does not implement interface Commandable
-        */
-       public static final function createWebCompanyCommandResolver ($commandName, ManageableApplication $appInstance) {
-               // Create the new instance
-               $resolverInstance = new WebCompanyCommandResolver();
-
-               // Get request instance
-               $requestInstance = $appInstance->getRequestInstance();
-
-               // Is the variable $commandName set and the command is valid?
-               if (empty($commandName)) {
-                       // Then thrown an exception here
-                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) {
-                       // Invalid command found (missing interface?)
-                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
-               }
-
-               // Set the application instance
-               $resolverInstance->setApplicationInstance($appInstance);
-
-               // Return the prepared instance
-               return $resolverInstance;
-       }
-
-       /**
-        * Returns an command instance for a given request class or null if
-        * it was not found
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @return      $commandInstance        An instance of the resolved command
-        * @throws      InvalidCommandException                         Thrown if $commandName is
-        *                                                                                              invalid
-        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
-        *                                                                                              is an invalid instance
-        */
-       public function resolveCommandByRequest (Requestable $requestInstance) {
-               // Init instance
-               $commandInstance = null;
-
-               // This goes fine so let's resolv the command
-               $commandName = str_replace('-', '_', $requestInstance->getRequestElement('app')) . '_' . $requestInstance->getRequestElement('page');
-
-               // Is there a "failed" request?
-               if ($requestInstance->isRequestElementSet('failed')) {
-                       // Then include with within the command name
-                       $commandName = $commandName . '_' . $requestInstance->getRequestElement('failed');
-               } // END - if
-
-               // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Check if command is valid
-               if ($this->isCommandValid($commandName) === false) {
-                       // This command is invalid!
-                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Get the command
-               $commandInstance = $this->loadCommand($commandName);
-
-               // And validate it
-               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
-                       // This command has an invalid instance!
-                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Set last command
-               $this->lastCommandInstance = $commandInstance;
-
-               // Return the resolved command instance
-               return $commandInstance;
-       }
-
-       /**
-        * Resolves the command by its direct name and returns an instance of its class
-        *
-        * @param       $commandName            The direct command name we shall resolve
-        * @return      $commandInstance        An instance of the command class
-        * @throws      InvalidCommandException         Thrown if $commandName is invalid
-        */
-       public function resolveCommand ($commandName) {
-               // Initiate the instance variable
-               $commandInstance = null;
-
-               // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Check if command is valid
-               if ($this->isCommandValid($commandName) === false) {
-                       // This command is invalid!
-                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               }
-
-               // Get the command
-               $commandInstance = $this->loadCommand($commandName);
-
-               // Return the instance
-               return $commandInstance;
-       }
-
-       /**
-        * "Loads" a given command and instances it if not yet cached
-        *
-        * @param       $commandName                            A command name we shall look for
-        * @return      $commandInstance                        A loaded command instance
-        * @throws      InvalidCommandException         Thrown if even the default
-        *                                                                              command class is missing (bad!)
-        */
-       private function loadCommand ($commandName) {
-               // Cache default command
-               $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Init command instance
-               $commandInstance = null;
-
-               // Get 'app' from the application
-               $app = Registry::getRegistry()->getInstance('application')->getRequestInstance()->getRequestElement('app');
-
-               // Create command class name
-               $this->setClassName(sprintf("%s%sCommand",
-                       $this->getCommandPrefix(),
-                       $this->convertToClassName($commandName)
-               ));
-
-               // Is this class loaded?
-               if (!class_exists($this->getClassName())) {
-                       // Class not found, so throw an exception
-                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Initiate the command
-               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
-
-               // Return the result
-               return $commandInstance;
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php b/application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php
deleted file mode 100644 (file)
index 9456c08..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php
-/**
- * A command resolver for local (non-hubbed) web commands including the failed government request
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements CommandResolver {
-       /**
-        * Last successfull resolved command
-        */
-       private $lastCommandInstance = null;
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set prefix to "Web"
-               $this->setCommandPrefix('Web');
-       }
-
-       /**
-        * Creates an instance of a Web command resolver with a given default command
-        *
-        * @param       $commandName                            The default command we shall execute
-        * @param       $appInstance                            An instance of a manageable application helper class
-        * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      EmptyVariableException          Thrown if default command is not set
-        * @throws      InvalidInterfaceException       Thrown if command does not implement interface Commandable
-        */
-       public static final function createWebGovernmentFailedCommandResolver ($commandName, ManageableApplication $appInstance) {
-               // Create the new instance
-               $resolverInstance = new WebGovernmentFailedCommandResolver();
-
-               // Get request instance
-               $requestInstance = $appInstance->getRequestInstance();
-
-               // Is the variable $commandName set and the command is valid?
-               if (empty($commandName)) {
-                       // Then thrown an exception here
-                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) {
-                       // Invalid command found (missing interface?)
-                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
-               }
-
-               // Set the application instance
-               $resolverInstance->setApplicationInstance($appInstance);
-
-               // Return the prepared instance
-               return $resolverInstance;
-       }
-
-       /**
-        * Returns an command instance for a given request class or null if
-        * it was not found
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @return      $commandInstance        An instance of the resolved command
-        * @throws      InvalidCommandException                         Thrown if $commandName is
-        *                                                                                              invalid
-        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
-        *                                                                                              is an invalid instance
-        */
-       public function resolveCommandByRequest (Requestable $requestInstance) {
-               // Init instance
-               $commandInstance = null;
-
-               // This goes fine so let's resolv the command
-               $commandName = $requestInstance->getRequestElement('page');
-
-               // Is there a "failed" request?
-               if ($requestInstance->isRequestElementSet('failed')) {
-                       // Then include with within the command name
-                       $commandName = sprintf("%s_%s", $commandName, $requestInstance->getRequestElement('failed'));
-               } // END - if
-
-               // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Check if command is valid
-               if ($this->isCommandValid($commandName) === false) {
-                       // This command is invalid!
-                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Get the command
-               $commandInstance = $this->loadCommand($commandName);
-
-               // And validate it
-               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
-                       // This command has an invalid instance!
-                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Set last command
-               $this->lastCommandInstance = $commandInstance;
-
-               // Return the resolved command instance
-               return $commandInstance;
-       }
-
-       /**
-        * Resolves the command by its direct name and returns an instance of its class
-        *
-        * @param       $commandName            The direct command name we shall resolve
-        * @return      $commandInstance        An instance of the command class
-        * @throws      InvalidCommandException         Thrown if $commandName is invalid
-        */
-       public function resolveCommand ($commandName) {
-               // Initiate the instance variable
-               $commandInstance = null;
-
-               // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Check if command is valid
-               if ($this->isCommandValid($commandName) === false) {
-                       // This command is invalid!
-                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               }
-
-               // Get the command
-               $commandInstance = $this->loadCommand($commandName);
-
-               // Return the instance
-               return $commandInstance;
-       }
-
-       /**
-        * "Loads" a given command and instances it if not yet cached
-        *
-        * @param       $commandName                            A command name we shall look for
-        * @return      $commandInstance                        A loaded command instance
-        * @throws      InvalidCommandException         Thrown if even the default
-        *                                                                              command class is missing (bad!)
-        */
-       private function loadCommand ($commandName) {
-               // Cache default command
-               $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
-
-               // Init command instance
-               $commandInstance = null;
-
-               // Create command class name
-               $this->setClassName(sprintf("%s%sCommand",
-                       $this->getCommandPrefix(),
-                       $this->convertToClassName($commandName)
-               ));
-
-               // Is this class loaded?
-               if (!class_exists($this->getClassName())) {
-                       // Class not found, so throw an exception
-                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
-               } // END - if
-
-               // Initiate the command
-               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
-
-               // Return the result
-               return $commandInstance;
-       }
-}
-
-// [EOF]
-?>