Source code of filesite.io.
https://filesite.io
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
1 year ago
|
<?php
|
||
|
/**
|
||
|
* List Controller
|
||
|
*/
|
||
|
require_once __DIR__ . '/../../../lib/DirScanner.php';
|
||
|
require_once __DIR__ . '/../../../plugins/Parsedown.php';
|
||
|
require_once __DIR__ . '/SiteController.php';
|
||
|
|
||
|
Class ApiController extends SiteController {
|
||
|
|
||
|
public function actionIndex() {
|
||
|
//获取数据
|
||
|
$menus = array(); //菜单,一级目录
|
||
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
|
||
|
$htmlCateReadme = ''; //当前目录下的Readme.md 内容
|
||
|
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
|
||
|
|
||
|
$scanner = new DirScanner();
|
||
|
$scanner->setWebRoot(FSC::$app['config']['content_directory']);
|
||
|
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3);
|
||
|
//$scanResults = $scanner->getScanResults();
|
||
|
|
||
|
$code = 1;
|
||
|
$msg = '';
|
||
|
$err = '';
|
||
|
|
||
|
//获取tags分类
|
||
|
$data = $this->getTags($dirTree);
|
||
|
|
||
|
|
||
|
return $this->renderJson(compact('code', 'msg', 'err', 'data'));
|
||
|
}
|
||
|
|
||
|
}
|