Definition at line 15 of file WhoopsServiceProvider.php.
◆ __construct()
Whoops\Provider\Phalcon\WhoopsServiceProvider::__construct |
( |
DI |
$di = null | ) |
|
- Parameters
-
Definition at line 20 of file WhoopsServiceProvider.php.
23 $di = DI::getDefault();
27 $di->setShared(
'whoops.pretty_page_handler',
function () {
28 return new PrettyPageHandler();
32 $di->setShared(
'whoops.json_response_handler',
function () {
33 $jsonHandler =
new JsonResponseHandler();
34 $jsonHandler->onlyForAjaxRequests(
true);
43 $phalcon_info_handler =
function () use ($di) {
45 $request = $di[
'request'];
53 $di[
'whoops.pretty_page_handler']->addDataTable(
'Phalcon Application (Request)', array(
54 'URI' => $request->getScheme().
'://'.$request->getServer(
'HTTP_HOST').$request->getServer(
'REQUEST_URI'),
55 'Request URI' => $request->getServer(
'REQUEST_URI'),
56 'Path Info' => $request->getServer(
'PATH_INFO'),
57 'Query String' => $request->getServer(
'QUERY_STRING') ?:
'<none>',
58 'HTTP Method' => $request->getMethod(),
59 'Script Name' => $request->getServer(
'SCRIPT_NAME'),
62 'Scheme' => $request->getScheme(),
63 'Port' => $request->getServer(
'SERVER_PORT'),
64 'Host' => $request->getServerName(),
68 $di->setShared(
'whoops',
function () use ($di,$phalcon_info_handler) {
70 $run->pushHandler($di[
'whoops.pretty_page_handler']);
71 $run->pushHandler($phalcon_info_handler);
72 $run->pushHandler($di[
'whoops.json_response_handler']);
76 $di[
'whoops']->register();
The documentation for this class was generated from the following file: