-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
52 lines (49 loc) · 2.06 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
@include_once __DIR__ . '/vendor/autoload.php';
use Kirby\Cms\App as Kirby;
Kirby::plugin('treast/debugbar', [
'options' => [
'force' => false,
'tabs' => [
'logs' => true,
'config' => true,
'events' => true,
'files' => true,
'variables' => true,
'request' => true,
'exceptions' => true
]
],
'hooks' => [
'system.loadPlugins:after' => function () {
\Treast\KirbyDebugbar\Debugbar::init(kirby());
},
'page.render:before' => function (string $contentType, array $data, \Kirby\Cms\Page $page) {
\Treast\KirbyDebugbar\Debugbar::logPage($page);
return $data;
},
'*:after' => function (\Kirby\Cms\Event $event) {
\Treast\KirbyDebugbar\Debugbar::logEvent($event);
},
'system.exception' => function (Throwable $exception) {
if ($exception instanceof Exception) \Treast\KirbyDebugbar\Debugbar::logException($exception);
},
],
'snippets' => [
'debugbar' => __DIR__ . '/snippets/debugbar.php'
],
'siteMethods' => [
'logger' => function () {
return \Treast\KirbyDebugbar\Debugbar::getLogger();
},
'log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)
],
'pageMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'pagesMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'fieldMethods' => ['log' => fn ($field) => \Treast\KirbyDebugbar\Debugbar::logUtils($field)],
'fileMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'filesMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'userMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'usersMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
'collectionMethods' => ['log' => fn () => \Treast\KirbyDebugbar\Debugbar::logUtils($this)],
]);