Replace constant DEBUG to use in Config. Remove start profiler from FrontController (moved to bootstrap).

This commit is contained in:
Alexander Demidov
2012-06-27 17:56:06 +04:00
parent bcc9be619d
commit cfd6536c5f
26 changed files with 134 additions and 322 deletions

View File

@ -32,9 +32,6 @@ class FrontController
private function __construct()
{
ErrorHandler::init();
if (DEBUG == true) {
Profiler::getInstance()->start();
}
$this->router = new Router();
}
@ -120,7 +117,7 @@ class FrontController
$layout = new $layout_class();
$html = $layout->fetch($action);
if (DEBUG) {
if (Config::get('PROFILER')) {
if (is_subclass_of($action, 'AjaxAction')) {
Profiler::getInstance()->getJson();
} else {
@ -129,7 +126,7 @@ class FrontController
}
return $html;
} catch (Exception $e) {
if (DEBUG == true) {
if (Config::get('DEBUG')) {
if (!headers_sent()) {
header('HTTP/1.0 500 Internal Server Error');
}