PHP 클래스 TQ\Vcs\Buffer\StreamBuffer

상속: implements TQ\Vcs\Buffer\FileBufferInterface
파일 보기 프로젝트 열기: teqneers/php-stream-wrapper-for-git 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$stream resource The file resource

공개 메소드들

메소드 설명
__construct ( string $path, string $mode = 'r+' ) Creates a new file buffer with the given path
__destruct ( ) Destructor closes file stream handle
close ( ) Closes the buffer
flush ( ) : boolean Flushes the buffer to the storage media
getBuffer ( ) : string Returns the complete contents of the buffer
getPosition ( ) : integer Returns the current pointer position
getStat ( ) : array Returns the stat information for the buffer
isEof ( ) : boolean Returns true if the pointer is at the end of the buffer
read ( integer $count ) : string | null Reads $count bytes from the buffer
setPosition ( integer $position, integer $whence ) : boolean Sets the pointer position
write ( string $data ) : integer Writes the given date into the buffer at the current pointer position

메소드 상세

__construct() 공개 메소드

Creates a new file buffer with the given path
public __construct ( string $path, string $mode = 'r+' )
$path string The path
$mode string The file mode

__destruct() 공개 메소드

Destructor closes file stream handle
public __destruct ( )

close() 공개 메소드

Closes the buffer
public close ( )

flush() 공개 메소드

Flushes the buffer to the storage media
public flush ( ) : boolean
리턴 boolean

getBuffer() 공개 메소드

Returns the complete contents of the buffer
public getBuffer ( ) : string
리턴 string

getPosition() 공개 메소드

Returns the current pointer position
public getPosition ( ) : integer
리턴 integer

getStat() 공개 메소드

Returns the stat information for the buffer
public getStat ( ) : array
리턴 array

isEof() 공개 메소드

Returns true if the pointer is at the end of the buffer
public isEof ( ) : boolean
리턴 boolean

read() 공개 메소드

Reads $count bytes from the buffer
public read ( integer $count ) : string | null
$count integer The number of bytes to read
리턴 string | null

setPosition() 공개 메소드

Sets the pointer position
public setPosition ( integer $position, integer $whence ) : boolean
$position integer The position in bytes
$whence integer The reference from where to measure $position (SEEK_SET, SEEK_CUR or SEEK_END)
리턴 boolean True if the position could be set

write() 공개 메소드

Writes the given date into the buffer at the current pointer position
public write ( string $data ) : integer
$data string The data to write
리턴 integer The number of bytes written

프로퍼티 상세

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

The file resource
protected resource $stream
리턴 resource