-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (40 loc) · 1.06 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
<?php
//TODO 将 127.0.0.1 替换为服务的真实 Host, 即可
$host = '127.0.0.1';
/**
* 动态的路径名称
*/
$realPath = '';
/**
* 即将收集的数据
*/
$allData = array();
function getDir($path, $realPath, $host, &$allData)
{
if (is_dir($path)) {
$dir = scandir($path);
foreach ($dir as $value) {
$sub_path = $path . '/' . $value;
if ($value == '.' || $value == '..') {
continue;
} elseif (is_dir($sub_path)) {
$realPath = $value;
getDir($sub_path, $realPath, $host, $allData);
} else {
if ($value == 'web.html') {
$url = 'http://'.$host.':8088/' . $path . '/' . $value;
$allData[$realPath][] = [$value, $url];
echo "<a target='_blank' href='$url'>🤖️️点击开始聊天👉: " . $value . '</a><br/>';
}
}
}
}
}
/**
* 当前路径名称
*/
$path = './';
/**
* 立刻调用
*/
getDir($path, $realPath, $host, $allData);