* controller class is missing (bad!)
*/
protected function loadController ($controllerName) {
- // Cache default command
+ // Cache default controller
$defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_controller');
// Init controller instance
// ... and set it
$this->setClassName($className);
} else {
- // No news at main command or non-news command
+ // No news at main controller or non-news controller
$this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController');
}
//* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('AFTER: controller=' . $this->getClassName());
// Try to read a config entry for our resolver including controller name... ;-)
$resolverConfigEntry = sprintf('%s_cmd_%s_resolver_class', strtolower($this->getClassPrefix()), strtolower($controllerName));
- // Get the config, this will throw an exception if there is no special command resolver
+ // Get the config, this will throw an exception if there is no special controller resolver
$resolverClass = $this->getConfigInstance()->getConfigEntry($resolverConfigEntry);
// Initiate the resolver and controller
}
/**
- * Resolves the default controller of the given command
+ * Resolves the default controller of the given controller
*
* @return $controllerInstance A controller instance for the default
- * command
+ * controller
* @throws InvalidControllerInstanceException Thrown if $controllerInstance
* is invalid
*/
$controllerName = '';
$controllerInstance = NULL;
- // Get the command name
+ // Get the controller name
$controllerName = $this->getControllerName();
- // Get the command
+ // Get the controller
$controllerInstance = $this->loadController($controllerName);
// And validate it
if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
- // This command has an invalid instance!
+ // This controller has an invalid instance!
throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
} // END - if
}
/**
- * Creates an instance of a resolver class with a given command
+ * Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
* @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
- * @throws EmptyVariableException Thrown if default command is not set
+ * @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
public static final function createConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
// Create the new instance
$resolverInstance = new ConsoleControllerResolver();
- // Is the variable $controllerName set and the command is valid?
+ // Is the variable $controllerName set and the controller is valid?
if (empty($controllerName)) {
// Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
- // Invalid command found
+ // Invalid controller found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
// Set the application instance
$resolverInstance->setApplicationInstance($applicationInstance);
- // Set command name
+ // Set controller name
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance
}
/**
- * Creates an instance of a resolver class with a given command
+ * Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
* @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
- * @throws EmptyVariableException Thrown if default command is not set
+ * @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
public static final function createHtmlControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
// Create the new instance
$resolverInstance = new HtmlControllerResolver();
- // Is the variable $controllerName set and the command is valid?
+ // Is the variable $controllerName set and the controller is valid?
if (empty($controllerName)) {
// Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
- // Invalid command found
+ // Invalid controller found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
// Set the application instance
$resolverInstance->setApplicationInstance($applicationInstance);
- // Set command name
+ // Set controller name
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance
}
/**
- * Creates an instance of a resolver class with a given command
+ * Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
* @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
- * @throws EmptyVariableException Thrown if default command is not set
+ * @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
public static final function createImageControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
// Create the new instance
$resolverInstance = new ImageControllerResolver();
- // Is the variable $controllerName set and the command is valid?
+ // Is the variable $controllerName set and the controller is valid?
if (empty($controllerName)) {
// Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
- // Invalid command found
+ // Invalid controller found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
// Set the application instance
$resolverInstance->setApplicationInstance($applicationInstance);
- // Set command name
+ // Set controller name
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance