* @return void
*/
public final function addFatalMessage ($messageId) {
+ // Get application instance
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Adds the resolved message id to the fatal message list
- $this->addFatalMessagePlain($this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
+ $this->addFatalMessagePlain($applicationInstance()->getLanguageInstance()->getMessage($messageId));
}
/**
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- public function flushBuffer ($force = FALSE) {
- if ((headers_sent()) && ($force === FALSE)) {
+ public function flushBuffer ($force = false) {
+ // Get application instance
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+ // Headers already sent?
+ if ((headers_sent()) && ($force === false)) {
// Headers are already sent!
throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
} elseif (!headers_sent()) {
$this->getWebOutputInstance()->output($this->responseBody);
} else {
// Display all error messages
- $this->getApplicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
+ $applicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
// Send the error messages out to the world
$this->getWebOutputInstance()->output($this->responseBody);