diff options
| author | 2014-03-22 17:56:07 +0100 | |
|---|---|---|
| committer | 2014-03-22 17:56:07 +0100 | |
| commit | 5081ffaf39699398f83be97e47b72444e5bcd5d1 (patch) | |
| tree | cf07bc40c955510785198ed74bbc931ee209439b /lib/Minz/Error.php | |
| parent | 69deb27f654a0d5d5e6fe77733d56a9c4fd29e03 (diff) | |
Minz: remove one layer of ob_ (experimental)
https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38351311
https://github.com/marienfressinaud/FreshRSS/issues/163
* Remove Minz_Response (not needed anymore)
* Move Minz_Request::reseted to Minz_Dispatcher::reset()
Diffstat (limited to 'lib/Minz/Error.php')
| -rw-r--r-- | lib/Minz/Error.php | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php index 337ab6c0a..c8222a430 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -23,13 +23,32 @@ class Minz_Error { $logs = self::processLogs ($logs); $error_filename = APP_PATH . '/Controllers/errorController.php'; + switch ($code) { + case 200 : + header('HTTP/1.1 200 OK'); + break; + case 403 : + header('HTTP/1.1 403 Forbidden'); + break; + case 404 : + header('HTTP/1.1 404 Not Found'); + break; + case 500 : + header('HTTP/1.1 500 Internal Server Error'); + break; + case 503 : + header('HTTP/1.1 503 Service Unavailable'); + break; + default : + header('HTTP/1.1 500 Internal Server Error'); + } + if (file_exists ($error_filename)) { $params = array ( 'code' => $code, 'logs' => $logs ); - Minz_Response::setHeader ($code); if ($redirect) { Minz_Request::forward (array ( 'c' => 'error' @@ -41,19 +60,16 @@ class Minz_Error { ), false); } } else { - $text = '<h1>An error occured</h1>'."\n"; + echo '<h1>An error occured</h1>' . "\n"; if (!empty ($logs)) { - $text .= '<ul>'."\n"; + echo '<ul>' . "\n"; foreach ($logs as $log) { - $text .= '<li>' . $log . '</li>'."\n"; + echo '<li>' . $log . '</li>' . "\n"; } - $text .= '</ul>'."\n"; + echo '</ul>' . "\n"; } - Minz_Response::setHeader ($code); - Minz_Response::setBody ($text); - Minz_Response::send (); exit (); } } |
