]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/resolver/command/class_BaseCommandResolver.php
Continued:
[core.git] / framework / main / classes / resolver / command / class_BaseCommandResolver.php
index 4dd1861efab2bc83f0d8c0ddb218beaac2b2dc45..2b319c1b508dd743e805da20884e84f2e386b7d0 100644 (file)
@@ -37,6 +37,11 @@ use \UnexpectedValueException;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseCommandResolver extends BaseResolver {
+       /**
+        * Command name
+        */
+       private $commandName = '';
+
        /**
         * Protected constructor
         *
@@ -48,6 +53,25 @@ abstract class BaseCommandResolver extends BaseResolver {
                parent::__construct($className);
        }
 
+       /**
+        * Setter for command name
+        *
+        * @param       $commandName    Last validated command name
+        * @return      void
+        */
+       protected final function setCommandName (string $commandName) {
+               $this->commandName = $commandName;
+       }
+
+       /**
+        * Getter for command name
+        *
+        * @return      $commandName    Last validated command name
+        */
+       protected final function getCommandName () {
+               return $this->commandName;
+       }
+
        /**
         * "Loads" a given command and instances it if not yet cached
         *
@@ -103,7 +127,7 @@ abstract class BaseCommandResolver extends BaseResolver {
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
-                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
+                       $commandName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
                } // END - if
 
                // Check if command is valid
@@ -152,7 +176,7 @@ abstract class BaseCommandResolver extends BaseResolver {
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
                        // Init default command
-                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
+                       $commandName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
                } // END - if
 
                // Check if command is valid