Replace constant DEBUG to use in Config. Remove start profiler from FrontController (moved to bootstrap).
This commit is contained in:
@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user