app/library/Bootstrap.php: use debugger if configured.
This commit is contained in:
parent
9dd712045a
commit
2e7c67ba8a
1 changed files with 20 additions and 3 deletions
|
|
@ -17,10 +17,11 @@ class Bootstrap extends Injectable
|
||||||
$this->setDI($di);
|
$this->setDI($di);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run()
|
/**
|
||||||
|
* Prepares the application to run.
|
||||||
|
*/
|
||||||
|
public function prepare()
|
||||||
{
|
{
|
||||||
$app = new Application($this->getDI());
|
|
||||||
|
|
||||||
// Force autoloader if registered.
|
// Force autoloader if registered.
|
||||||
// Should be needed by almost all other services.
|
// Should be needed by almost all other services.
|
||||||
$di = $this->getDI();
|
$di = $this->getDI();
|
||||||
|
|
@ -28,6 +29,22 @@ class Bootstrap extends Injectable
|
||||||
$di->get('loader');
|
$di->get('loader');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If debug is configured. add listener.
|
||||||
|
if ($di->get('config')->application->debug) {
|
||||||
|
$di->get('debugger')->listen(true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the application.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
$app = new Application($this->getDI());
|
||||||
return $app->handle()->getContent();
|
return $app->handle()->getContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue