More code merged from ship-simu
[mailer.git] / inc / classes / main / resolver / web / class_WebCommandResolver.php
index 47baef47bfc4cceabea389d6e49aa602e24413cd..fa52125d68a944b13b6a37e3fac32c6b9fabea51 100644 (file)
@@ -40,7 +40,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                $this->setObjectDescription("Resolver for local web commands");
 
                // Create unique ID number
-               $this->createUniqueID();
+               $this->generateUniqueId();
 
                // Set prefix to "Web"
                $this->setCommandPrefix("Web");
@@ -184,19 +184,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                }
 
                // 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;