mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 05:50:50 +00:00
【程序目录】优化获取文件目录代码
This commit is contained in:
parent
b03f923b95
commit
c885ebfac3
@ -253,15 +253,14 @@ class SystemFileServices extends BaseServices
|
||||
} else {
|
||||
$dir = $dir . '/' . $fileDir;
|
||||
}
|
||||
$list = scandir($dir);
|
||||
//获取目录列表
|
||||
$list = array_diff(scandir($dir), array('.', '..'));
|
||||
foreach ($list as $key => $v) {
|
||||
if ($v != '.' && $v != '..') {
|
||||
if (is_dir($dir . DS . $v)) {
|
||||
$fileAll['dir'][] = FileClass::listInfo($dir . DS . $v);
|
||||
}
|
||||
if (is_file($dir . DS . $v)) {
|
||||
$fileAll['file'][] = FileClass::listInfo($dir . DS . $v);
|
||||
}
|
||||
if (is_dir($dir . DS . $v)) {
|
||||
$fileAll['dir'][] = FileClass::listInfo($dir . DS . $v);
|
||||
}
|
||||
if (is_file($dir . DS . $v)) {
|
||||
$fileAll['file'][] = FileClass::listInfo($dir . DS . $v);
|
||||
}
|
||||
}
|
||||
//兼容windows
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user