Class: WindFile
Source Location: /utility/WindFile.php
Class WindFile
Constant Summary
READ |
以读的方式打开文件,具有较强的平台移植性 |
WRITE |
以写的方式打开文件,具有较强的平台移植性 |
Method Summary
static
boolean
|
del() |
删除文件 |
static
string
|
read() |
读取文件 |
Methods
static boolean del(
string
$filename
)
|
|
删除文件
Parameters:
API Tags:
static array getInfo(
string
$fileName
)
|
|
取得文件信息
Parameters:
API Tags:
Return: | 文件信息 |
Access: | public |
static string getSuffix(
string
$filename
)
|
|
取得文件后缀
Parameters:
API Tags:
static boolean isFile(
string
$fileName
)
|
|
Parameters:
API Tags:
static string read(
string
$fileName, [string
$method = self::READ]
)
|
|
读取文件
Parameters:
string |
$fileName: |
文件绝对路径 |
string |
$method: |
读取模式默认模式为rb |
API Tags:
Return: | 从文件中读取的数据 |
Access: | public |
static void savePhpData(
string
$fileName, mixed
$data, [boolean
$isBuildReturn = true], [string
$method = self::READWRITE], [boolean
$ifLock = true]
)
|
|
保存文件
Parameters:
string |
$fileName: |
保存的文件名 |
mixed |
$data: |
保存的数据 |
boolean |
$isBuildReturn: |
是否组装保存的数据是return $params的格式,如果没有则以变量声明的方式保存,默认为true则以return的方式保存 |
string |
$method: |
打开文件方式,默认为rb+的形式 |
boolean |
$ifLock: |
是否对文件加锁,默认为true即加锁 |
API Tags:
static int write(
string
$fileName, string
$data, [string
$method = self::READWRITE], [bool
$ifLock = true], [bool
$ifCheckPath = true], [bool
$ifChmod = true]
)
|
|
写文件
Parameters:
string |
$fileName: |
文件绝对路径 |
string |
$data: |
数据 |
string |
$method: |
读写模式,默认模式为rb+ |
bool |
$ifLock: |
是否锁文件,默认为true即加锁 |
bool |
$ifCheckPath: |
是否检查文件名中的“..”,默认为true即检查 |
bool |
$ifChmod: |
是否将文件属性改为可读写,默认为true |
API Tags:
Return: | 返回写入的字节数 |
Access: | public |
|
|