]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/resolver/web/class_WebCommandResolver.php
Intercepting filter basicly added, generic form processor implemented (unfinished...
[shipsimu.git] / inc / classes / main / resolver / web / class_WebCommandResolver.php
index 2ab4e50035275e81cff71b98f26c6673a72d4dad..05bcd6509023136521c163ec8cf0310a3276549a 100644 (file)
@@ -53,23 +53,23 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
        /**
         * Creates an instance of a Web command resolver with a given default command
         *
-        * @param       $defaultCommand                         The default command we shall execute
+        * @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 the default command is not set
         * @throws      InvalidCommandException         Thrown if the default command is invalid
         */
-       public final static function createWebCommandResolver ($defaultCommand, ManageableApplication $appInstance) {
+       public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
                // Create the new instance
                $resolverInstance = new WebCommandResolver();
 
-               // Is the variable $defaultCommand set and the command is valid?
-               if (empty($defaultCommand)) {
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isCommandValid($defaultCommand)) {
+               } elseif (!$resolverInstance->isCommandValid($commandName)) {
                        // Invalid command found
-                       throw new InvalidCommandException(array($resolverInstance, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
 
                // Set the application instance
@@ -145,7 +145,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
 
                // Create command class name
                $class = sprintf("Web%sCommand",
-                       ucfirst(strtolower($commandName))
+                       $this->convertToClassName($commandName)
                );
 
                // Is this class loaded?