PHP 클래스 Pop\File\File

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allowed array Array of allowed file types.
$basename string Full basename of file, i.e. 'file.ext'
$dir string Full, absolute directory of file, i.e. '/some/dir/'
$ext string File extension, i.e. 'ext'
$filename string Full filename of file, i.e. 'file'
$fullpath string Full path and name of the file, i.e. '/some/dir/file.ext'
$mime string File mime type
$output string File output data.
$size integer File size in bytes

공개 메소드들

메소드 설명
__construct ( string $file, array $types = null ) : File Constructor
addAllowedTypes ( array $types ) : void Set the allowed files types.
append ( string $data ) : File Append data to a file.
checkDupe ( string $file, string $dir = null ) : string Static method to check for a duplicate file, returning the next incremented filename, i.e. filename_1.txt
copy ( string $new, boolean $overwrite = false ) : File Copy the file object directly to another file on disk.
delete ( ) : void Delete the file object directly from disk.
getAllowedTypes ( ) : array Get the current allowed files types.
getBasename ( ) : string Get the basename.
getDir ( ) : string Get the directory.
getDirGroup ( ) : array Get the owner of the file. Works on POSIX file systems only
getDirOwner ( ) : array Get the owner of the file. Works on POSIX file systems only
getDirPermissions ( ) : string Get the permissions of the directory the file is in.
getExt ( ) : string Get the extension.
getFilename ( ) : string Get the filename.
getFullpath ( ) : string Get the fullpath.
getGroup ( ) : array Get the owner of the file. Works on POSIX file systems only
getMime ( ) : string Get the current file mime type.
getOwner ( ) : array Get the owner of the file. Works on POSIX file systems only
getPermissions ( ) : string Get the permissions of the file.
getSize ( ) : string Get the current file size.
getUser ( ) : array Get current user. Works on POSIX file systems only
isAllowed ( string $type ) : boolean Test if a certain file type is allowed.
isDir ( ) : boolean Is dir object.
isFile ( ) : boolean Is file object.
move ( string $new, boolean $overwrite = false ) : File Move the file object directly to another location on disk.
output ( boolean $download = false ) : File Output the file object directly.
read ( integer | string $off = null, integer | string $len = null ) : string Read data from a file.
save ( string $to = null, boolean $append = false ) : File Save the file object to disk.
setAllowedTypes ( array $types = null ) : void Set the allowed files types, overriding any previously allowed types.
setDirPermissions ( mixed $mode ) : File Change the permissions of the directory the file is in.
setMime ( string $mime ) : File Set the file mime type.
setPermissions ( mixed $mode ) : File Change the permissions of the file.
upload ( string $upload, string $file, integer $size, array $types = null ) : File Static method to upload a file and return a file object.
write ( string $data, boolean $append = false ) : File Write data to a file.

보호된 메소드들

메소드 설명
setFile ( string $file, array $types = null ) : void Set the file and its properties.

메소드 상세

__construct() 공개 메소드

Instantiate the file object, either from a file on disk or as a new file.
public __construct ( string $file, array $types = null ) : File
$file string
$types array
리턴 File

addAllowedTypes() 공개 메소드

Set the allowed files types.
public addAllowedTypes ( array $types ) : void
$types array
리턴 void

append() 공개 메소드

Append data to a file.
public append ( string $data ) : File
$data string
리턴 File

checkDupe() 공개 정적인 메소드

Static method to check for a duplicate file, returning the next incremented filename, i.e. filename_1.txt
public static checkDupe ( string $file, string $dir = null ) : string
$file string
$dir string
리턴 string

copy() 공개 메소드

Copy the file object directly to another file on disk.
public copy ( string $new, boolean $overwrite = false ) : File
$new string
$overwrite boolean
리턴 File

delete() 공개 메소드

Delete the file object directly from disk.
public delete ( ) : void
리턴 void

getAllowedTypes() 공개 메소드

Get the current allowed files types.
public getAllowedTypes ( ) : array
리턴 array

getBasename() 공개 메소드

Get the basename.
public getBasename ( ) : string
리턴 string

getDir() 공개 메소드

Get the directory.
public getDir ( ) : string
리턴 string

getDirGroup() 공개 메소드

Get the owner of the file. Works on POSIX file systems only
public getDirGroup ( ) : array
리턴 array

getDirOwner() 공개 메소드

Get the owner of the file. Works on POSIX file systems only
public getDirOwner ( ) : array
리턴 array

getDirPermissions() 공개 메소드

Get the permissions of the directory the file is in.
public getDirPermissions ( ) : string
리턴 string

getExt() 공개 메소드

Get the extension.
public getExt ( ) : string
리턴 string

getFilename() 공개 메소드

Get the filename.
public getFilename ( ) : string
리턴 string

getFullpath() 공개 메소드

Get the fullpath.
public getFullpath ( ) : string
리턴 string

getGroup() 공개 메소드

Get the owner of the file. Works on POSIX file systems only
public getGroup ( ) : array
리턴 array

getMime() 공개 메소드

Get the current file mime type.
public getMime ( ) : string
리턴 string

getOwner() 공개 메소드

Get the owner of the file. Works on POSIX file systems only
public getOwner ( ) : array
리턴 array

getPermissions() 공개 메소드

Get the permissions of the file.
public getPermissions ( ) : string
리턴 string

getSize() 공개 메소드

Get the current file size.
public getSize ( ) : string
리턴 string

getUser() 공개 메소드

Get current user. Works on POSIX file systems only
public getUser ( ) : array
리턴 array

isAllowed() 공개 메소드

Test if a certain file type is allowed.
public isAllowed ( string $type ) : boolean
$type string
리턴 boolean

isDir() 공개 메소드

Is dir object.
public isDir ( ) : boolean
리턴 boolean

isFile() 공개 메소드

Is file object.
public isFile ( ) : boolean
리턴 boolean

move() 공개 메소드

Move the file object directly to another location on disk.
public move ( string $new, boolean $overwrite = false ) : File
$new string
$overwrite boolean
리턴 File

output() 공개 메소드

Output the file object directly.
public output ( boolean $download = false ) : File
$download boolean
리턴 File

read() 공개 메소드

Read data from a file.
public read ( integer | string $off = null, integer | string $len = null ) : string
$off integer | string
$len integer | string
리턴 string

save() 공개 메소드

Save the file object to disk.
public save ( string $to = null, boolean $append = false ) : File
$to string
$append boolean
리턴 File

setAllowedTypes() 공개 메소드

Set the allowed files types, overriding any previously allowed types.
public setAllowedTypes ( array $types = null ) : void
$types array
리턴 void

setDirPermissions() 공개 메소드

Change the permissions of the directory the file is in.
public setDirPermissions ( mixed $mode ) : File
$mode mixed
리턴 File

setFile() 보호된 메소드

Set the file and its properties.
protected setFile ( string $file, array $types = null ) : void
$file string
$types array
리턴 void

setMime() 공개 메소드

Set the file mime type.
public setMime ( string $mime ) : File
$mime string
리턴 File

setPermissions() 공개 메소드

Change the permissions of the file.
public setPermissions ( mixed $mode ) : File
$mode mixed
리턴 File

upload() 공개 정적인 메소드

Static method to upload a file and return a file object.
public static upload ( string $upload, string $file, integer $size, array $types = null ) : File
$upload string
$file string
$size integer
$types array
리턴 File

write() 공개 메소드

Write data to a file.
public write ( string $data, boolean $append = false ) : File
$data string
$append boolean
리턴 File

프로퍼티 상세

$allowed 보호되어 있는 프로퍼티

Array of allowed file types.
protected array $allowed
리턴 array

$basename 보호되어 있는 프로퍼티

Full basename of file, i.e. 'file.ext'
protected string $basename
리턴 string

$dir 보호되어 있는 프로퍼티

Full, absolute directory of file, i.e. '/some/dir/'
protected string $dir
리턴 string

$ext 보호되어 있는 프로퍼티

File extension, i.e. 'ext'
protected string $ext
리턴 string

$filename 보호되어 있는 프로퍼티

Full filename of file, i.e. 'file'
protected string $filename
리턴 string

$fullpath 보호되어 있는 프로퍼티

Full path and name of the file, i.e. '/some/dir/file.ext'
protected string $fullpath
리턴 string

$mime 보호되어 있는 프로퍼티

File mime type
protected string $mime
리턴 string

$output 보호되어 있는 프로퍼티

File output data.
protected string $output
리턴 string

$size 보호되어 있는 프로퍼티

File size in bytes
protected int $size
리턴 integer