首页›文件与媒体›Core\File 属性与路径
Core\File 属性与路径
Kuoqi\Core\File(471 行):文件对象基类
路径方法
| 方法 | 签名 | 说明 |
|---|---|---|
__construct | ($filename="") | 创建文件对象 |
setFile | setFile($file) | 设置文件路径 |
getFile | getFile($isTrue=true) | 文件路径(realpath) |
getPath | getPath($isTrue=false) | 目录路径 |
getFullname / getName | getFullname() / getName() | 完整路径/文件名 |
getExt | getExt() | 真实扩展名(finfo + MimeFactory 判定) |
getMd5 | getMd5() | 文件 MD5 |
getSize | getSize($withContent=true) | 文件大小(含未保存内容) |
setBasename | setBasename($basename) | 设置文件名 |
stdExt | static stdExt($filename) | 标准扩展名判定 |
isFile | isFile($file) | 是否文件 |
典型用法
$file = new \Kuoqi\Core\File("{@ROOT}/Public/a.txt");
echo $file->getName(); // a.txt
echo $file->getExt(); // txt
echo $file->getMd5(); // 文件指纹
echo $file->getSize();
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI ·
返回首页