新增在线查询支持站点表格显示

This commit is contained in:
iyuu.cn
2020-01-21 02:18:23 +08:00
parent 7c35291b15
commit 36d07a25db
4 changed files with 339 additions and 44 deletions

View File

@ -342,37 +342,3 @@ function object_array($array)
}
return $array;
}
/**
* 显示支持的站点列表
*/
function ShowTableSites(){
$data = [];
$i = $j = $k = 0;
foreach(glob(APP_PATH.'Protocols'.DS.'*.php') as $key => $start_file)
{
$start_file = str_replace("\\","/",$start_file);
$offset = strripos($start_file,'/');
if ($offset===false) {
$start_file = substr($start_file,0,-4);
} else {
$start_file = substr($start_file,$offset+1,-4);
}
// 过滤示例、过滤解码接口
if (in_array($start_file,['axxxx','decodeBase'])) {
continue;
}
// 控制多少列
if ($i > 4) {
$k++;
$i = 0;
}
$i++;
$j++;
$data[$k][] = $j.". ".$start_file;
}
//输出表格
$table = new Table();
$table->setRows($data);
echo($table->render());
}