parent::__construct(__CLASS__);
// Set prefix to "Image"
- $this->setCommandPrefix('Image');
+ $this->setClassPrefix('Image');
}
/**
$commandName = $requestInstance->getRequestElement('page');
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+ if (empty($commandName)) {
+ $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+ } // END - if
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
} // END - if
// Set last command
- $this->lastCommandInstance = $commandInstance;
+ $this->setResolvedInstance($commandInstance);
// Return the resolved command instance
return $commandInstance;
$commandInstance = null;
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+ if (empty($commandName)) {
+ $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+ } // END - if
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
- }
+ } // END - if
// Get the command
$commandInstance = $this->loadCommand($commandName);
$commandInstance = null;
// Create class name
- $className = $this->getCommandPrefix() . $this->convertToClassName($commandName) . 'Command';
+ $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
// Is this class loaded?
if (!class_exists($this->getClassName())) {