forked from perftools/xhgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
110 lines (88 loc) · 3.17 KB
/
routes.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Routes for Xhgui
*/
$app->error(function (Exception $e) use ($di, $app) {
$view = $di['view'];
$view->parserOptions['cache'] = false;
$view->parserExtensions = array(
new Xhgui_Twig_Extension($app)
);
// Remove the controller so we don't render it.
unset($app->controller);
$app->view($view);
$app->render('error/view.twig', array(
'message' => $e->getMessage(),
'stack_trace' => $e->getTraceAsString(),
));
});
// Profile Runs routes
$app->get('/', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->index();
})->name('home');
$app->get('/run/view', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->view();
})->name('run.view');
$app->get('/url/view', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->url();
})->name('url.view');
$app->get('/run/compare', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->compare();
})->name('run.compare');
$app->get('/run/symbol', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->symbol();
})->name('run.symbol');
$app->get('/run/symbol/short', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->symbolShort();
})->name('run.symbol-short');
$app->get('/run/callgraph', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->callgraph();
})->name('run.callgraph');
$app->get('/run/callgraph/data', function () use ($di, $app) {
$di['runController']->callgraphData();
})->name('run.callgraph.data');
$app->get('/run/flamegraph', function () use ($di, $app) {
$app->controller = $di['runController'];
$app->controller->flamegraph();
})->name('run.flamegraph');
$app->get('/run/flamegraph/data', function () use ($di, $app) {
$di['runController']->flamegraphData();
})->name('run.flamegraph.data');
$app->get('/run/callgraph/dot', function () use ($di, $app) {
$di['runController']->callgraphDataDot();
})->name('run.callgraph.dot');
// Watch function routes.
$app->get('/watch', function () use ($di, $app) {
$app->controller = $di['watchController'];
$app->controller->get();
})->name('watch.list');
$app->post('/watch', function () use ($di) {
$di['watchController']->post();
})->name('watch.save');
// Custom report routes.
$app->get('/custom', function () use ($di, $app) {
$app->controller = $di['customController'];
$app->controller->get();
})->name('custom.view');
$app->get('/custom/help', function () use ($di, $app) {
$app->controller = $di['customController'];
$app->controller->help();
})->name('custom.help');
$app->post('/custom/query', function () use ($di) {
$di['customController']->query();
})->name('custom.query');
// Waterfall routes
$app->get('/waterfall', function () use ($di, $app) {
$app->controller = $di['waterfallController'];
$app->controller->index();
})->name('waterfall.list');
$app->get('/waterfall/data', function () use ($di) {
$di['waterfallController']->query();
})->name('waterfall.data');