*/
private $templateInstance = NULL;
+ /**
+ * Response type
+ */
+ private $responseType = 'invalid';
+
/**
* Protected constructor
*
$this->responseBody = $output;
}
+ /**
+ * Setter for response type
+ *
+ * @param $responseType Response type
+ * @return void
+ */
+ protected final function setResponseType ($responseType) {
+ $this->responseType = $responseType;
+ }
+
+ /**
+ * Getter for response type
+ *
+ * @param $responseType Response type
+ * @return void
+ */
+ public final function getResponseType () {
+ return $this->responseType;
+ }
+
/**
* Adds a fatal message id to the response. The added messages can then be
* processed and outputed to the world
$this->setResponseBody('');
$this->resetResponseHeaders();
}
+
+ /**
+ * "Getter" for default command
+ *
+ * @return $defaultCommand Default command for this response
+ */
+ public function getDefaultCommand () {
+ // Get application instance
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+ // Generate config key
+ $configKey = sprintf('default_%s_%s_command',
+ $applicationInstance->getAppShortName(),
+ $this->getResponseType()
+ );
+
+ // Get default command response
+ $defaultCommand = $this->getConfigInstance()->getConfigEntry($configKey);
+
+ // Return it
+ return $defaultCommand;
+ }
}
// [EOF]
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Set response type
+ $this->setResponseType('image');
}
/**
$this->partialStub('Naturally unimplemented in console response.');
}
- /**
- * Getter for default command
- *
- * @return $defaultCommand Default command for this response
- */
- public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_console_command');
- return $defaultCommand;
- }
-
/**
* Flushs the cached console response to the console
*
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Set response type
+ $this->setResponseType('image');
}
/**
$this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
} // END - if
}
-
- /**
- * Getter for default command
- *
- * @return $defaultCommand Default command for this response
- */
- public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_html_command');
- return $defaultCommand;
- }
}
// [EOF]
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Set response type
+ $this->setResponseType('image');
}
/**
$this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
} // END - if
}
-
- /**
- * Getter for default command
- *
- * @return $defaultCommand Default command for this response
- */
- public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_image_command');
- return $defaultCommand;
- }
}
// [EOF]