-
Notifications
You must be signed in to change notification settings - Fork 16
/
push-log-viewer.php
40 lines (36 loc) · 1020 Bytes
/
push-log-viewer.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
$empty = array_key_exists('empty', $_GET);
$files = array();
if ($handle = opendir('push_log')) {
while (false !== ($entry = readdir($handle))) {
if($entry != '.' && $entry != '..') {
if($empty) {
unlink('push_log/' . $entry);
} else {
$files[] = $entry;
}
}
}
closedir($handle);
}
?>
<html>
<head>
<title>Push log viewer</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<h1>Messages pushed to this app</h1>
<div style="border:1px solid black;">
<ul>
<?php foreach($files as $file): ?>
<li/> <a href="push_log/<?php echo $file; ?>"><?php echo $file ?></a>
<?php endforeach; ?>
</ul>
</div>
<p>
<a href="push-log-viewer.php?empty=true">Empty log</a>
<a href="index.php">Home</a>.
</p>
</body>
</html>