forked from tungnguyenson/xdebug-trace-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (25 loc) · 907 Bytes
/
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
<?php
ini_set('memory_limit', '4096M');
set_time_limit(-1);
include 'XtExplorer.php';
// scan xdebug trace output dir for files
$traceFolder = ini_get('xdebug.trace_output_dir');
$files = $traceFolder ? scandir($traceFolder) : [];
$traceFiles = [];
foreach ($files as $f) {
if ($f != '.' && $f != '..') $traceFiles[] = $f;
}
// also accept custom path
$traceFile = isset($_GET['filePath'])?$_GET['filePath']:'trace.sample.xt';
$maxLine = isset($_GET['maxLine'])?$_GET['maxLine']:10000;
$maxLevel = isset($_GET['maxLevel'])?$_GET['maxLevel']:10;
$defaultToExpand = '
{main},Tala::loadConfig
{main},Tala\Mvc\Application->run
';
$toExpand = isset($_GET['toExpand'])?$_GET['toExpand']:$defaultToExpand;
$toExpandArray = preg_split("/\r\n|\n|\r/", trim($toExpand));
if ($traceFile != '') {
$traceExplorer = new XtExplorer($traceFile, $maxLine, $maxLevel, $toExpandArray);
}
include 'view.php';