*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* Last successfull resolved controller (name)
*/
- private $lastControllerName = "";
+ private $lastControllerName = '';
/**
* Last successfull resolved controller (instance)
*/
public function resolveController () {
// Init variables
- $controllerName = "";
+ $controllerName = '';
$controllerInstance = null;
// Get the command name
//* DEBUG: */ echo __METHOD__.": Controller=".$controllerName;
if ($controllerName != $defaultController) {
// Create controller class name
- $this->setClassName(sprintf("Image%sController",
- $this->convertToClassName($controllerName)
- ));
+ $className = 'Image' . $this->convertToClassName($controllerName) . 'Controller';
+
+ // ... and set it
+ $this->setClassName($className);
} // END - if
//* DEBUG: */ echo ", controller=".$this->getClassName()."<br />\n";
} // END - if
// Initiate the resolver and controller
- $resolverInstance = ObjectFactory::createObjectByConfiguredName('image_cmd_resolver_class', array($controllerName, $this->getApplicationInstance()));
- $controllerInstance = ObjectFactory::createObjectByName($this->getClassName(), array($resolverInstance));
-
- // Remove resolver
- unset($resolverInstance);
+ $resolverInstance = ObjectFactory::createObjectByConfiguredName(
+ 'image_cmd_resolver_class',
+ array(
+ $controllerName,
+ $this->getApplicationInstance()
+ )
+ );
+ $controllerInstance = ObjectFactory::createObjectByName(
+ $this->getClassName(),
+ array($resolverInstance)
+ );
// Return the result
return $controllerInstance;