File
in
文件操作 File Management
Table of Contents
write() | 写入文件 write | bool |
---|---|---|
new() | 新建文件(已存在会被覆盖) | bool |
makeDirs() | 根据结构生成文件夹 generate directories by struct | void |
dirList() | 根据结构生成目录 dirList | array |
addDir() | 建立文件夹 | bool |
addFile() | 建立文件 | bool |
moveDir() | 移动文件夹 | bool |
moveFile() | 移动文件 | bool |
removeDir() | 删除文件夹 | bool |
removeFile() | 删除文件 | bool |
copyDir() | 复制文件夹 | void |
copyFile() | 复制文件 | bool |
Methods
write()
写入文件 write
public
static write(
$filename :
string
, $content :
mixed
[, $path :
string|null
= NULL ]
[, $mode :
string
= 'a' ]
)
: bool
Parameters
- $filename : string
- $content : mixed
- $path : string|null = NULL
- $mode : string = 'a'
Return values
boolnew()
新建文件(已存在会被覆盖)
public
static new(
$filename :
string
, $content :
mixed
[, $path :
string|null
= NULL ]
)
: bool
Parameters
- $filename : string
- $content : mixed
- $path : string|null = NULL
Return values
boolmakeDirs()
根据结构生成文件夹 generate directories by struct
public
static makeDirs(
$struct :
array
[, $path :
string
= '' ]
)
: void
Parameters
- $struct : array
- $path : string = ''
dirList()
根据结构生成目录 dirList
public
static dirList(
$struct :
array
[, $path :
string
= '' ]
)
: array
Parameters
- $struct : array
[description]
- $path : string = ''
[description]
Return values
arrayaddDir()
建立文件夹
public
static addDir(
$aimUrl :
string
)
: bool
Parameters
- $aimUrl : string
Return values
booladdFile()
建立文件
public
static addFile(
$aimUrl :
string
[, $overWrite :
bool
= false ]
)
: bool
Parameters
- $aimUrl : string
- $overWrite : bool = false
该参数控制是否覆盖原文件
Return values
boolmoveDir()
移动文件夹
public
static moveDir(
$oldDir :
string
, $aimDir :
string
[, $overWrite :
bool
= false ]
)
: bool
Parameters
- $oldDir : string
- $aimDir : string
- $overWrite : bool = false
该参数控制是否覆盖原文件
Return values
boolmoveFile()
移动文件
public
static moveFile(
$fileUrl :
string
, $aimUrl :
string
[, $overWrite :
bool
= false ]
)
: bool
Parameters
- $fileUrl : string
- $aimUrl : string
- $overWrite : bool = false
该参数控制是否覆盖原文件
Return values
boolremoveDir()
删除文件夹
public
static removeDir(
$aimDir :
string
)
: bool
Parameters
- $aimDir : string
Return values
boolremoveFile()
删除文件
public
static removeFile(
$aimUrl :
string
)
: bool
Parameters
- $aimUrl : string
Return values
boolcopyDir()
复制文件夹
public
static copyDir(
$oldDir :
string
, $aimDir :
string
[, $overWrite :
bool
= false ]
)
: void
Parameters
- $oldDir : string
- $aimDir : string
- $overWrite : bool = false
该参数控制是否覆盖原文件
copyFile()
复制文件
public
static copyFile(
$fileUrl :
string
, $aimUrl :
string
[, $overWrite :
bool
= false ]
)
: bool
Parameters
- $fileUrl : string
- $aimUrl : string
- $overWrite : bool = false
该参数控制是否覆盖原文件