boolean changeDir(
string
$dir
)
|
|
更改当前目录到指定目录下
Parameters:
string |
$dir: |
需要设置为当前目录的目录 |
API Tags:
Return: | 设置成功则返回true,失败则返回false |
Abstract: | |
Access: | public |
Redefined in descendants as:
boolean checkFile(
string
$filename
)
|
|
检查文件类型
Parameters:
API Tags:
Return: | 如果文件带有.php字串则返回false,否则返回true |
Access: | protected |
Information Tags:
关闭ftp链接
API Tags:
Return: | 返回关闭链接是否成功 |
Abstract: | |
Access: | public |
Redefined in descendants as:
boolean delete(
string
$filename
)
|
|
删除文件
Parameters:
API Tags:
Return: | 删除成功返回true,删除失败返回false |
Abstract: | |
Access: | public |
Redefined in descendants as:
boolean download(
string
$localfile, [string
$remotefile = ''], [string
$mode = 'A']
)
|
|
下载文件
Parameters:
string |
$localfile: |
下载文件存放位置 |
string |
$remotefile: |
待下载的文件 |
string |
$mode: |
下载的模式二进制还是ASCII上传,I为二进制模式,A为ASCII模式,默认为A模式 |
API Tags:
Return: | 返回文件下载是否成功 |
Abstract: | |
Access: | public |
Redefined in descendants as:
array fileList(
[string
$dir = '']
)
|
|
列出给定目录的文件列表
Parameters:
string |
$dir: |
目录,默认为空即为当前目录 |
API Tags:
Return: | 返回该目录下的文件列表 |
Abstract: | |
Access: | public |
Redefined in descendants as:
boolean file_exists(
string
$filename
)
|
|
检查文件是否存在
Parameters:
API Tags:
Return: | 文件存在则返回true,失败则返回false |
Access: | public |
string getExt(
string
$filename
)
|
|
获得文件后缀
Parameters:
API Tags:
Return: | 返回文件的后缀,如果传入的文件没有后缀将会返回txt |
Access: | protected |
boolean initConfig(
array
$config
)
|
|
初始化配置信息
Parameters:
array |
$config: |
ftp的配置信息: - server: ftp主机地址
- port: ftp链接端口号,默认为21
- user: ftp链接用户名
- pwd: ftp链接用户密码
- dir: ftp链接后切换的目录,默认为空
- timeout: ftp链接超时时间,默认为10秒
|
API Tags:
Return: | 配置成功返回true,配置失败返回false |
Access: | public |
Redefined in descendants as:
boolean mkdir(
string
$dir
)
|
|
创建文件夹
Parameters:
API Tags:
Return: | 创建文件夹成功则返回true,失败则返回false |
Abstract: | |
Access: | public |
Redefined in descendants as:
boolean mkdirs(
string
$dir, [string
$permissions = 0777]
)
|
|
级联创建文件夹
Parameters:
string |
$dir: |
待创建文件夹路径 |
string |
$permissions: |
创建的文件夹的权限 |
API Tags:
Return: | 创建成功返回true创建失败返回false |
Access: | public |
获得当前路径
API Tags:
Return: | 返回当前路径 |
Abstract: | |
Access: | protected |
Redefined in descendants as:
boolean rename(
string
$oldName, string
$newName
)
|
|
重命名文件
Parameters:
string |
$oldName: |
现在的文件名 |
string |
$newName: |
新的文件名 |
API Tags:
Return: | 重命名成功则返回true,失败则返回false |
Abstract: | |
Access: | public |
Redefined in descendants as:
void showError(
string
$str, [boolean
$close = true]
)
|
|
显示错误信息
Parameters:
string |
$str: |
错误信息 |
boolean |
$close: |
是否关闭链接,默认为true需要关闭链接 |
API Tags:
获得文件大小
Parameters:
API Tags:
Return: | 获取成功返回文件大小 |
Abstract: | |
Access: | public |
Redefined in descendants as:
int upload(
string
$sourceFile, string
$desFile, [string
$mode = 'A']
)
|
|
上传文件
Parameters:
string |
$sourceFile: |
待上传的文件 |
string |
$desFile: |
文件上传的存放位置 |
string |
$mode: |
上传模式二进制还是ASCII上传,I为二进制模式,A为ASCII模式,默认为A模式 |
API Tags:
Return: | 返回上传文件的大小 |
Abstract: | |
Access: | public |
Redefined in descendants as: