]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/main/resolver/web/class_WebControllerResolver.php
More code merged from ship-simu
[mailer.git] / inc / classes / main / resolver / web / class_WebControllerResolver.php
index 9e50d94516dfe8a99b592f7a8a73b33257257eaa..b5f66e85314c923e1e952b8b0bb76ea75b4f52b7 100644 (file)
@@ -45,7 +45,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                $this->setObjectDescription("Resolver for local web controllers");
 
                // Create unique ID number
-               $this->createUniqueID();
+               $this->generateUniqueId();
 
                // Set prefix to "Web"
                $this->setCommandPrefix("Web");
@@ -173,22 +173,14 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                                // Still not found?
                                throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
                        }
-               }
-
-               // Initiate the controller
-               $eval = sprintf("\$controllerInstance = %s::create%s(WebCommandResolver::createWebCommandResolver(\$commandName, \$this->getApplicationInstance()));",
-                       $class,
-                       $class
-               );
+               } // END - if
 
-               // Run the command
-               eval($eval);
+               // Initiate the resolver and controller
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver', array($commandName, $this->getApplicationInstance()));
+               $controllerInstance = ObjectFactory::createObjectByName($class, array($resolverInstance));
 
-               // Is the instance valid?
-               if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
-                       // Something is wrong
-                       $controllerInstance = null;
-               }
+               // Remove resolver
+               unset($resolverInstance);
 
                // Return the result
                return $controllerInstance;