-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
132 lines (116 loc) · 3.26 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/**
* devindex
* A simple PHP tool to place in your development environment's
* public_html directory.
*
* Assume's installation of:
* webgrind - git clone https://github.com/jokkedk/webgrind.git
* adminer - git clone https://github.com/vrana/adminer/
* git submodule update --init
*
* @version 0.0.2
* @author https://github.com/webworker01
* @link https://github.com/webworker01/devindex
* @since PHP 7.0.25
* @license MIT
* @license https://opensource.org/licenses/MIT
*/
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$special = [
'phpinfo.php' => 'PHP Info',
'memcache.php' => 'Memcache Stats',
'ocp.php' => 'OPCache Stats 3',
'op.php' => 'OPCache Stats 2',
'opcache.php' => 'OPCache Stats',
'webgrind' => 'Webgrind',
'adminer' => 'Adminer - Database Tool',
];
$ignorefiles = [
'index.php',
'.gitignore',
'composer.phar',
'.git',
];
$dir_open = opendir('.');
$files = [];
$dirs = [];
$tools = [];
while(false !== ($filename = readdir($dir_open))){
if( $filename != "." && $filename != ".." && !in_array($filename, $ignorefiles) ){
if ( !array_key_exists($filename, $special) ) {
if ( is_dir($filename) ) {
$dirs[] = $filename;
} else {
$files[] = $filename;
}
} else {
$tools[] = $filename;
}
}
}
closedir($dir_open);
?>
<!doctype html>
<html>
<head>
<style>
body {
background-color: #0A0A0A;
color: #EBEBEB;
margin:0;
padding:0;
}
a {
color: #4298B5;
}
.row {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: flex-start;
margin:0;
}
ul {
flex: 1;
flex-direction: column;
flex-grow: 1;
border-left: 1px solid rgba(255, 255, 255, 20);
border-right: 1px solid rgba(255, 255, 255, 20);
padding-left: 10%;
height: 100vh;
margin: 0 auto;
}
ul li:first-child {
font-weight:900;
font-size:1.1em;
}
ul li {
list-style-type:none;
}
</style>
</head>
<body>
<div class="row">
<ul>
<li>Tools</li>
<?php foreach ($tools as $file): ?>
<li><a href="<?= $file; ?>"><?= $special[$file]; ?></a></li>
<?php endforeach; ?>
</ul>
<ul>
<li>Directories</li>
<?php foreach ($dirs as $file): ?>
<li><a href="<?= $file; ?>"><?= $file; ?></a></li>
<?php endforeach; ?>
</ul>
<ul>
<li>Files</li>
<?php foreach ($files as $file): ?>
<li><a href="<?= $file; ?>"><?= $file; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</body>
</html>