-
Notifications
You must be signed in to change notification settings - Fork 36
/
index.php
54 lines (51 loc) · 1.68 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
53
54
<?php
/*
* Aikar's Minecraft Timings Parser
*
* Written by Aikar <aikar@aikar.co>
* http://aikar.co
* http://starlis.com
*
* @license MIT
*/
namespace Starlis\Timings;
require_once __DIR__ . "/init.php";
Timings::bootstrap();
$assets = "dist/webpack-assets.json";
$stamp = filemtime($assets);
$assets = json_decode(file_get_contents($assets), true);
foreach ($assets as $k => $asset) {
foreach ($asset as $id => $f) {
$assets[$k][$id] = "$f?$stamp";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<title>Aikar's Timings Viewer</title>
<meta name="description" content="Aikar's Timings Viewer - View Timings v2 reports from Paper and Sponge"/>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
crossorigin="anonymous">
<?php
$theme = 'blue1-dark';
if (!empty($_COOKIE['timings-theme'])) {
$cookie = basename($_COOKIE['timings-theme']);
if (file_exists(ROOT_DIR . "/src/css/themes/$cookie.scss")) $theme = $cookie;
}
global $ini;
?>
<script type="text/javascript">TIMINGS_THEME =<?=json_encode($theme);?>;</script>
<script type="text/javascript">CACHE_VER =<?=json_encode($ini['cache_ver']);?>;</script>
<link href="<?= htmlentities($assets["timings"]['css']) ?>" rel="stylesheet"/>
<link href="<?= htmlentities($assets["timings-theme-{$theme}"]['css']) ?>" rel="stylesheet"/>
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<div id="wrapper"></div>
<script src="<?= htmlentities($assets['vendor']['js']) ?>"></script>
<script src="<?= htmlentities($assets['timings']['js']) ?>"></script>
</body>
</html>