X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Fweb%2Fclass_WebCommandResolver.php;h=4b8a3bacf369437126f3f021f5fb0b95ef7617f0;hb=12dbc1af8f0bc2981711b17c7c955f270c440b35;hp=47baef47bfc4cceabea389d6e49aa602e24413cd;hpb=12a993738a1d1bea29a886e06478beb145c275e5;p=hub.git diff --git a/inc/classes/main/resolver/web/class_WebCommandResolver.php b/inc/classes/main/resolver/web/class_WebCommandResolver.php index 47baef47b..4b8a3bacf 100644 --- a/inc/classes/main/resolver/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/web/class_WebCommandResolver.php @@ -36,12 +36,6 @@ class WebCommandResolver extends BaseResolver implements CommandResolver { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local web commands"); - - // Create unique ID number - $this->createUniqueID(); - // Set prefix to "Web" $this->setCommandPrefix("Web"); } @@ -94,7 +88,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver { // Test if the required parameter is set try { // This goes fine so let's resolv the command - $commandName = $requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter')); + $commandName = $requestInstance->getRequestElement("page"); // Is the command empty? Then fall back to default command if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command'); @@ -181,22 +175,10 @@ class WebCommandResolver extends BaseResolver implements CommandResolver { // Still not found? throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); } - } + } // END - if // Initiate the command - $eval = sprintf("\$commandInstance = %s::create%s(\$this);", - $className, - $className - ); - - // Run the command - eval($eval); - - // Is the instance valid? - if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { - // Something is wrong - $commandInstance = null; - } + $commandInstance = ObjectFactory::createObjectByName($className, array($this)); // Return the result return $commandInstance;