PHP Class Dir, thinksns

Mostra file Open project: medz/thinksns-4 Class Usage Examples

Public Methods

Method Description
__construct ( string $path, $pattern = '*' ) +---------------------------------------------------------- 架构函数 +---------------------------------------------------------- +----------------------------------------------------------
copyDir ( $source, $destination ) +---------------------------------------------------------- 复制目录 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
del ( $directory ) +---------------------------------------------------------- 删除目录下面的所有文件,但不删除目录 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
delDir ( $directory, $subdir = true ) +---------------------------------------------------------- 删除目录(包括下面的文件) +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
getATime ( ) : integer +---------------------------------------------------------- 文件上次访问时间 +---------------------------------------------------------- +----------------------------------------------------------
getCTime ( ) : integer +---------------------------------------------------------- 取得文件的 inode 修改时间 +---------------------------------------------------------- +----------------------------------------------------------
getChildren ( ) : DirectoryIterator +---------------------------------------------------------- 遍历子目录文件信息 +---------------------------------------------------------- +----------------------------------------------------------
getFilename ( ) : string +---------------------------------------------------------- 取得文件名 +---------------------------------------------------------- +----------------------------------------------------------
getGroup ( ) : integer +---------------------------------------------------------- 取得文件的组 +---------------------------------------------------------- +----------------------------------------------------------
getInode ( ) : integer +---------------------------------------------------------- 取得文件的 inode +---------------------------------------------------------- +----------------------------------------------------------
getIterator ( ) : string +---------------------------------------------------------- 获取foreach的遍历方式 +---------------------------------------------------------- +----------------------------------------------------------
getList ( $directory ) +---------------------------------------------------------- 取得目录中的结构信息 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
getMTime ( ) : integer +---------------------------------------------------------- 取得文件的上次修改时间 +---------------------------------------------------------- +----------------------------------------------------------
getOwner ( ) : string +---------------------------------------------------------- 取得文件的所有者 +---------------------------------------------------------- +----------------------------------------------------------
getPath ( ) : string +---------------------------------------------------------- 取得文件路径,不包括文件名 +---------------------------------------------------------- +----------------------------------------------------------
getPathname ( ) : string +---------------------------------------------------------- 取得文件的完整路径,包括文件名 +---------------------------------------------------------- +----------------------------------------------------------
getPerms ( ) : integer +---------------------------------------------------------- 取得文件的权限 +---------------------------------------------------------- +----------------------------------------------------------
getSize ( ) : integer +---------------------------------------------------------- 取得文件的大小 +---------------------------------------------------------- +----------------------------------------------------------
getType ( ) : string +---------------------------------------------------------- 取得文件类型 +---------------------------------------------------------- +----------------------------------------------------------
isDir ( ) : boolen +---------------------------------------------------------- 是否为目录 +---------------------------------------------------------- +----------------------------------------------------------
isEmpty ( $directory ) +---------------------------------------------------------- 判断目录是否为空 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
isExecutable ( ) : boolen +---------------------------------------------------------- 文件是否可以执行 +---------------------------------------------------------- +----------------------------------------------------------
isFile ( ) : boolen +---------------------------------------------------------- 是否为文件 +---------------------------------------------------------- +----------------------------------------------------------
isLink ( ) : boolen +---------------------------------------------------------- 文件是否为一个符号连接 +---------------------------------------------------------- +----------------------------------------------------------
isReadable ( ) : boolen +---------------------------------------------------------- 文件是否可读 +---------------------------------------------------------- +----------------------------------------------------------
listFile ( mixed $pathname, $pattern = '*' ) +---------------------------------------------------------- 取得目录下面的文件信息 +---------------------------------------------------------- +----------------------------------------------------------
toArray ( ) 返回目录的数组信息

Method Details

__construct() public method

+---------------------------------------------------------- 架构函数 +---------------------------------------------------------- +----------------------------------------------------------
public __construct ( string $path, $pattern = '*' )
$path string 目录路径 +----------------------------------------------------------

copyDir() public method

+---------------------------------------------------------- 复制目录 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public copyDir ( $source, $destination )

del() public method

+---------------------------------------------------------- 删除目录下面的所有文件,但不删除目录 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public del ( $directory )

delDir() public method

+---------------------------------------------------------- 删除目录(包括下面的文件) +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public delDir ( $directory, $subdir = true )

getATime() public method

+---------------------------------------------------------- 文件上次访问时间 +---------------------------------------------------------- +----------------------------------------------------------
public getATime ( ) : integer
return integer +----------------------------------------------------------

getCTime() public method

+---------------------------------------------------------- 取得文件的 inode 修改时间 +---------------------------------------------------------- +----------------------------------------------------------
public getCTime ( ) : integer
return integer +----------------------------------------------------------

getChildren() public method

+---------------------------------------------------------- 遍历子目录文件信息 +---------------------------------------------------------- +----------------------------------------------------------
public getChildren ( ) : DirectoryIterator
return DirectoryIterator +----------------------------------------------------------

getFilename() public method

+---------------------------------------------------------- 取得文件名 +---------------------------------------------------------- +----------------------------------------------------------
public getFilename ( ) : string
return string +----------------------------------------------------------

getGroup() public method

+---------------------------------------------------------- 取得文件的组 +---------------------------------------------------------- +----------------------------------------------------------
public getGroup ( ) : integer
return integer +----------------------------------------------------------

getInode() public method

+---------------------------------------------------------- 取得文件的 inode +---------------------------------------------------------- +----------------------------------------------------------
public getInode ( ) : integer
return integer +----------------------------------------------------------

getIterator() public method

+---------------------------------------------------------- 获取foreach的遍历方式 +---------------------------------------------------------- +----------------------------------------------------------
public getIterator ( ) : string
return string +----------------------------------------------------------

getList() public method

+---------------------------------------------------------- 取得目录中的结构信息 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public getList ( $directory )

getMTime() public method

+---------------------------------------------------------- 取得文件的上次修改时间 +---------------------------------------------------------- +----------------------------------------------------------
public getMTime ( ) : integer
return integer +----------------------------------------------------------

getOwner() public method

+---------------------------------------------------------- 取得文件的所有者 +---------------------------------------------------------- +----------------------------------------------------------
public getOwner ( ) : string
return string +----------------------------------------------------------

getPath() public method

+---------------------------------------------------------- 取得文件路径,不包括文件名 +---------------------------------------------------------- +----------------------------------------------------------
public getPath ( ) : string
return string +----------------------------------------------------------

getPathname() public method

+---------------------------------------------------------- 取得文件的完整路径,包括文件名 +---------------------------------------------------------- +----------------------------------------------------------
public getPathname ( ) : string
return string +----------------------------------------------------------

getPerms() public method

+---------------------------------------------------------- 取得文件的权限 +---------------------------------------------------------- +----------------------------------------------------------
public getPerms ( ) : integer
return integer +----------------------------------------------------------

getSize() public method

+---------------------------------------------------------- 取得文件的大小 +---------------------------------------------------------- +----------------------------------------------------------
public getSize ( ) : integer
return integer +----------------------------------------------------------

getType() public method

+---------------------------------------------------------- 取得文件类型 +---------------------------------------------------------- +----------------------------------------------------------
public getType ( ) : string
return string +----------------------------------------------------------

isDir() public method

+---------------------------------------------------------- 是否为目录 +---------------------------------------------------------- +----------------------------------------------------------
public isDir ( ) : boolen
return boolen +----------------------------------------------------------

isEmpty() public method

+---------------------------------------------------------- 判断目录是否为空 +---------------------------------------------------------- +---------------------------------------------------------- +----------------------------------------------------------
public isEmpty ( $directory )

isExecutable() public method

+---------------------------------------------------------- 文件是否可以执行 +---------------------------------------------------------- +----------------------------------------------------------
public isExecutable ( ) : boolen
return boolen +----------------------------------------------------------

isFile() public method

+---------------------------------------------------------- 是否为文件 +---------------------------------------------------------- +----------------------------------------------------------
public isFile ( ) : boolen
return boolen +----------------------------------------------------------

isReadable() public method

+---------------------------------------------------------- 文件是否可读 +---------------------------------------------------------- +----------------------------------------------------------
public isReadable ( ) : boolen
return boolen +----------------------------------------------------------

listFile() public method

+---------------------------------------------------------- 取得目录下面的文件信息 +---------------------------------------------------------- +----------------------------------------------------------
public listFile ( mixed $pathname, $pattern = '*' )
$pathname mixed 路径 +----------------------------------------------------------

toArray() public method

返回目录的数组信息
public toArray ( )