This repository was archived by the owner on Jan 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzray.php
More file actions
38 lines (28 loc) · 1.51 KB
/
zray.php
File metadata and controls
38 lines (28 loc) · 1.51 KB
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
<?php
use mako\application\Application;
//--------------------------------------------------------------------------
// Setup Z-Ray extension
//--------------------------------------------------------------------------
$zrayExtension = new ZRayExtension('Mako');
$zrayExtension->setMetadata(['logo' => __DIR__ . DIRECTORY_SEPARATOR . 'logo.png']);
//--------------------------------------------------------------------------
// Enable extension after Application::run has been executed
//--------------------------------------------------------------------------
$zrayExtension->setEnabledAfter('mako\application\web\Application::run');
//--------------------------------------------------------------------------
// Add config panel
//--------------------------------------------------------------------------
$zrayExtension->traceFunction('mako\http\Response::send', function(){}, function($context, &$storage)
{
$storage['configuration'] = [Application::instance()->getConfig()->getLoadedConfiguration()];
});
//--------------------------------------------------------------------------
// Add session panel
//--------------------------------------------------------------------------
$zrayExtension->traceFunction('mako\session\Session::start', function(){}, function($context, &$storage) use ($zrayExtension)
{
$zrayExtension->traceFunction('mako\session\Session::__destruct', function($context, &$storage)
{
$storage['session'] = [Application::instance()->getContainer()->get('session')->getData()];
}, function(){});
});