PHP 클래스 PHPDaemon\FS\FileSystem

저자: Vasily Zorin ([email protected])
상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\EventLoopContainer
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$badFDttl TTL for bad descriptors in seconds
$eioVer Required EIO version
$ev Main FS event
$fd EIO file descriptor
$fdCache File descriptor cache
$fdCacheSize Maximum number of open files in cache
$modeTypes Mode types
$supported Is EIO supported?

공개 메소드들

메소드 설명
__construct ( )
checkFileReadable ( string $path ) : boolean Checks if file exists and readable
chown ( string $path, integer $uid, integer $gid, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Changes ownership of file/directory
genRndTempnam ( string $dir = null, string $prefix = 'php' ) : string Returns random temporary file name
genRndTempnamPrefix ( string $dir, string $prefix ) : string Returns random temporary file name
init ( ) : void Initialize FS driver
initEvent ( ) : void Initialize main FS event
lstat ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true lstat()
mkdir ( string $path, integer $mode, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Creates directory
open ( string $path, string $flags, callable $cb, integer $mode = null, integer $pri = EIO_PRI_DEFAULT ) : resource Open file
readdir ( string $path, callable $cb = null, integer $flags = null, integer $pri = EIO_PRI_DEFAULT ) : resource | true Readdir()
readfile ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true Reads whole file
readfileChunked ( string $path, callable $cb, callable $chunkcb, integer $pri = EIO_PRI_DEFAULT ) : resource Reads file chunk-by-chunk
realpath ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true realpath()
rename ( string $path, string $newpath, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Rename
rmdir ( string $path, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Removes empty directory
sanitizePath ( string $path ) : string Sanitize path
sendfile ( mixed $outfd, string $path, callable $cb, callable $startCb = null, integer $offset, integer $length = null, integer $pri = EIO_PRI_DEFAULT ) : true sendfile()
stat ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true Gets stat() information
statPrepare ( mixed $stat ) : array Prepare value of stat()
statvfs ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | false statvfs()
sync ( callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | false sync()
syncfs ( callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | false statfs()
tempnam ( string $dir, string $prefix, callable $cb ) : resource Obtain exclusive temporary file
touch ( string $path, integer $mtime, integer $atime = null, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean touch()
truncate ( string $path, integer $offset, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Truncate file
unlink ( string $path, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean Unlink file
updateConfig ( ) : void Called when config is updated
waitAllEvents ( ) : void Block until all FS events are completed

보호된 메소드들

메소드 설명
tempnamHandler ( $dir, $prefix, $cb, &$tries ) Generates closure tempnam handler

메소드 상세

__construct() 공개 메소드

public __construct ( )

checkFileReadable() 공개 정적인 메소드

Checks if file exists and readable
public static checkFileReadable ( string $path ) : boolean
$path string Path
리턴 boolean Exists and readable?

chown() 공개 정적인 메소드

Changes ownership of file/directory
public static chown ( string $path, integer $uid, integer $gid, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$uid integer User ID
$gid integer Group ID
$cb callable = null Callback
$pri integer = EIO_PRI_DEFAULT Priority
리턴 resource | boolean

genRndTempnam() 공개 정적인 메소드

Returns random temporary file name
public static genRndTempnam ( string $dir = null, string $prefix = 'php' ) : string
$dir string Directory
$prefix string Prefix
리턴 string Path

genRndTempnamPrefix() 공개 정적인 메소드

Returns random temporary file name
public static genRndTempnamPrefix ( string $dir, string $prefix ) : string
$dir string Directory
$prefix string Prefix
리턴 string Path

init() 공개 정적인 메소드

Initialize FS driver
public static init ( ) : void
리턴 void

initEvent() 공개 정적인 메소드

Initialize main FS event
public static initEvent ( ) : void
리턴 void

lstat() 공개 정적인 메소드

lstat()
public static lstat ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true
$path string Path
$cb callable Callback
$pri integer Priority
리턴 resource | true

mkdir() 공개 정적인 메소드

Creates directory
public static mkdir ( string $path, integer $mode, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$mode integer Mode (octal)
$cb callable Callback
$pri integer Priority
리턴 resource | boolean

open() 공개 정적인 메소드

Open file
public static open ( string $path, string $flags, callable $cb, integer $mode = null, integer $pri = EIO_PRI_DEFAULT ) : resource
$path string Path
$flags string Flags
$cb callable Callback (File)
$mode integer Mode (see EIO_S_I* constants)
$pri integer Priority
리턴 resource

readdir() 공개 정적인 메소드

Readdir()
public static readdir ( string $path, callable $cb = null, integer $flags = null, integer $pri = EIO_PRI_DEFAULT ) : resource | true
$path string Path
$cb callable = null Callback
$flags integer = null Flags
$pri integer = EIO_PRI_DEFAULT Priority
리턴 resource | true

readfile() 공개 정적인 메소드

Reads whole file
public static readfile ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true
$path string Path
$cb callable Callback (Path, Contents)
$pri integer Priority
리턴 resource | true

readfileChunked() 공개 정적인 메소드

Reads file chunk-by-chunk
public static readfileChunked ( string $path, callable $cb, callable $chunkcb, integer $pri = EIO_PRI_DEFAULT ) : resource
$path string Path
$cb callable Callback (Path, Success)
$chunkcb callable Chunk callback (Path, Chunk)
$pri integer Priority
리턴 resource

realpath() 공개 정적인 메소드

realpath()
public static realpath ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true
$path string Path
$cb callable Callback
$pri integer Priority
리턴 resource | true

rename() 공개 정적인 메소드

Rename
public static rename ( string $path, string $newpath, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$newpath string New path
$cb callable Callback
$pri integer Priority
리턴 resource | boolean

rmdir() 공개 정적인 메소드

Removes empty directory
public static rmdir ( string $path, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$cb callable Callback
$pri integer Priority
리턴 resource | boolean

sanitizePath() 공개 정적인 메소드

Sanitize path
public static sanitizePath ( string $path ) : string
$path string Path
리턴 string Sanitized path

sendfile() 공개 정적인 메소드

sendfile()
public static sendfile ( mixed $outfd, string $path, callable $cb, callable $startCb = null, integer $offset, integer $length = null, integer $pri = EIO_PRI_DEFAULT ) : true
$outfd mixed File descriptor
$path string Path
$cb callable Callback
$startCb callable Start callback
$offset integer Offset
$length integer Length
$pri integer Priority
리턴 true Success

stat() 공개 정적인 메소드

Gets stat() information
public static stat ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | true
$path string Path
$cb callable Callback
$pri integer Priority
리턴 resource | true

statPrepare() 공개 정적인 메소드

Prepare value of stat()
public static statPrepare ( mixed $stat ) : array
$stat mixed Data
리턴 array hash

statvfs() 공개 정적인 메소드

statvfs()
public static statvfs ( string $path, callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | false
$path string Path
$cb callable Callback
$pri integer Priority
리턴 resource | false

sync() 공개 정적인 메소드

sync()
public static sync ( callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | false
$cb callable Callback
$pri integer Priority
리턴 resource | false

syncfs() 공개 정적인 메소드

statfs()
public static syncfs ( callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | false
$cb callable Callback
$pri integer Priority
리턴 resource | false

tempnam() 공개 정적인 메소드

Obtain exclusive temporary file
public static tempnam ( string $dir, string $prefix, callable $cb ) : resource
$dir string Directory
$prefix string Prefix
$cb callable Callback (File)
리턴 resource

tempnamHandler() 보호된 정적인 메소드

Generates closure tempnam handler
protected static tempnamHandler ( $dir, $prefix, $cb, &$tries )
$dir
$prefix
$cb
$tries

touch() 공개 정적인 메소드

touch()
public static touch ( string $path, integer $mtime, integer $atime = null, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$mtime integer Last modification time
$atime integer Last access time
$cb callable Callback
$pri integer Priority
리턴 resource | boolean

truncate() 공개 정적인 메소드

Truncate file
public static truncate ( string $path, integer $offset, callable $cb = null, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$path string Path
$offset integer Offset
$cb callable Callback
$pri integer Priority
리턴 resource | boolean

updateConfig() 공개 정적인 메소드

Called when config is updated
public static updateConfig ( ) : void
리턴 void

waitAllEvents() 공개 정적인 메소드

Block until all FS events are completed
public static waitAllEvents ( ) : void
리턴 void

프로퍼티 상세

$badFDttl 공개적으로 정적으로 프로퍼티

TTL for bad descriptors in seconds
public static $badFDttl

$eioVer 공개적으로 정적으로 프로퍼티

Required EIO version
public static $eioVer

$ev 공개적으로 정적으로 프로퍼티

Main FS event
public static $ev

$fd 공개적으로 정적으로 프로퍼티

EIO file descriptor
public static $fd

$fdCache 공개적으로 정적으로 프로퍼티

File descriptor cache
public static $fdCache

$fdCacheSize 공개적으로 정적으로 프로퍼티

Maximum number of open files in cache
public static $fdCacheSize

$modeTypes 공개적으로 정적으로 프로퍼티

Mode types
public static $modeTypes

$supported 공개적으로 정적으로 프로퍼티

Is EIO supported?
public static $supported