throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (!$resolverInstance->isControllerValid($controllerName)) {
// Invalid command found
- throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_COMMAND);
+ throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
// Set the application instance
*
* @param $controllerName A controller name we shall look for
* @return $controllerInstance A loaded controller instance
- * @throws DefaultControllerException Thrown if even the default
+ * @throws InvalidControllerException Thrown if even the requested
* controller class is missing (bad!)
*/
private function loadController ($controllerName) {
//* DEBUG: */ $this->debugBackTrace();
// Cache default command
- $defaultController = $this->getConfigInstance()->readConfig('default_command');
+ $defaultController = $this->getConfigInstance()->readConfig('default_web_command');
// Init controller instance
$controllerInstance = null;
// Is this class loaded?
if (!class_exists($this->getClassName())) {
- // Class not found, so try the default one or throw exception
- if ($controllerName != $defaultController) {
- // Try the default controller
- return $this->loadController($defaultController);
- } else {
- // Still not found?
- throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
- }
+ // Throw an exception here
+ throw new InvalidControllerException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
} // END - if
// Initiate the resolver and controller