文件管理已关闭~~';
header("refresh:3;url=" . $config['domain'] . '?manag-closed');
exit(require_once APP_ROOT . '/app/footer.php');
}
/**结束 - 自定义修改 */
// 目录绝对路径,结尾不加 `/`
// RexHelper::$root = $_SERVER['DOCUMENT_ROOT'];
RexHelper::$root = $_SERVER['DOCUMENT_ROOT'];
// 系统用户列表,密码类型 MD5
RexHelper::$users[$config['user']] = array(
'password' => $config['password']
);
// 可编辑文件后缀,开头不加 `.`
// RexHelper::$text_suff[] = "jsx";
// RexHelper::$text_suff[] = "php5";
// 文件排除规则,仅正则表达式
RexHelper::$ignore_list = array(
'/^\.git|.php|.htaccess|robots.txt|favicon.ico|README.md/', '/^admin|api|app|config|docs|install|public/'
);
session_start();
?>
名称 |
大小 |
权限 |
所有者 |
创建时间 |
操作 |
';
foreach ($fslist as $item) {
$suffix = $item->isDir() ? '/' : '';
$srpath = RexHelper::path_ator($item->getRealPath());
if (RexHelper::is_ignore($item->getFileName())) {
continue;
}
echo '';
if (RexHelper::file_catetory($srpath) == 'image') {
echo '
| ';
} else {
echo '
' . $item->getFileName() . $suffix . '
| ';
}
echo '
' . ($item->isFile() ? RexHelper::format_bytes($item->getSize()) : '-') . ' |
' . substr(sprintf('%o', $item->getPerms()), -4) . ' |
' . $item->getOwner() . ':' . $item->getGroup() . ' | ' . date('Y-m-d H:i', $item->getCTime()) . ' |
查看|改名|权限|删除 |
';
}
echo '
';
}
/**
* 新增目录视图
* @param string $path 路径
*/
static function view_newdir($path)
{
echo '
';
}
/**
* 新增文件视图
* @param string $path 路径
*/
static function view_newfile($path)
{
echo '
';
}
/**
* 编辑文件内容视图
* @param string $path 路径
*/
static function view_edit($path)
{
$sapath = RexHelper::path_rtoa($path);
$category = RexHelper::file_catetory($sapath);
switch ($category) {
case 'text':
$c = htmlspecialchars(file_get_contents($sapath));
echo '
';
return;
case 'image':
echo '
';
return;
default:
echo '
';
return;
}
}
/**
* 上传文件视图
* @param string $path 路径
*/
static function view_upload($path)
{
echo '
';
}
/**
* 重命名文件视图
* @param string $path 路径
*/
static function view_rename($path)
{
echo '
';
}
/**
* 编辑权限视图
* @param string $path 路径
*/
static function view_chmod($path)
{
$sapath = RexHelper::path_rtoa($path);
$perms = substr(sprintf("%o", fileperms($sapath)), -4);
echo '
';
}
/**
* 压缩文件视图
* @param string $path 路径
*/
static function view_zip($path)
{
echo '
注意,所有路径都相对于目录 ' . RexHelper::$root . '
文件列表:每个路径一行,支持排除路径
包含路径示例:/www/app
排除路径示例:exclude /www/app/log
';
}
/**
* 解压缩文件视图
* @param string $path 路径
*/
static function view_unzip($path)
{
echo '
';
}
/**
* 全局操作菜单
* @param string $path 路径
* @param string $view 视图
*/
static function body_navbar($path, $view)
{
$pdir = $path;
if (!is_dir(RexHelper::path_rtoa($path))) {
$pdir = dirname($path);
}
$member = RexAction::user_info();
echo '
';
}
/**
* 路径转为导航
* @param string $path 路径
*/
static function body_breadcrumb($path)
{
echo '
';
}
/**
* URL重定向
* @param string $url 重定向的URL地址
* @param integer $sec 重定向的等待时间(秒)
* @param string $msg 重定向前的提示信息
* @return void
*/
static function url_redirect($url, $sec, $msg = '')
{
$url = str_replace(array("\n", "\r"), '', $url);
$msg = $sec == 1 ? '操作成功!' : '操作失败!';
$cat = $sec == 1 ? 'success' : 'danger';
echo '
' . $msg . $sec . '秒后重定向到 ' . $url . '
';
exit('