eval() commands replace by improved object factory, user login class stub added
[shipsimu.git] / inc / classes / main / resolver / web / class_WebControllerResolver.php
index 7da1934bb8d467f50e73352ff287b26f0d7b38f1..b5f66e85314c923e1e952b8b0bb76ea75b4f52b7 100644 (file)
@@ -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;