-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
40 lines (40 loc) · 1.35 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
<?php declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', 'true');
?>
<?php
$dir = ini_get('xdebug.trace_output_dir') ?: '/var/www/html/watson/watson-pathfinder/xdebug-trace-files/';
?>
<!doctype html>
<html lang="en_gb">
<head>
<title>Watson: Pathfinder</title>
<link rel="stylesheet" href="res/style.css">
</head>
<body>
<p>Reading files from <code><?= htmlspecialchars($dir) ?></code></p>
<form method="post" class="load">
<p>
<label for="file">File:</label>
<select name="file" id="file">
<?php
$files = glob("$dir/*");
foreach ($files as $file) :
$checked = ($file == $_REQUEST['file']) ? 'selected="selected"' : '';
echo '<option value="' . htmlspecialchars($file) . '" ' . $checked . '>' . htmlspecialchars(basename($file)) . '</option>';
endforeach;
?>
</select>
<button type="submit">Load</button>
</p>
</form>
<?php
if (!empty($_REQUEST['file'])) :
require_once 'res/XdebugParser.php';
$parser = new XdebugParser($_REQUEST['file']);
$parser->parse();
echo $parser->getTraceHTML();
endif;
?>
</body>
</html>