PHP 클래스 org\bovigo\vfs\vfsStreamWrapper

파일 보기 프로젝트 열기: mikey179/vfsstream 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$content shortcut to file container
$dir shortcut to directory container
$dirIterator shortcut to directory container iterator
$mode file mode: read only, write only, all
$registered switch whether class has already been registered as stream wrapper or not
$root root content

공개 메소드들

메소드 설명
dir_closedir ( ) : boolean closes directory
dir_opendir ( string $path, integer $options ) : boolean opens a directory
dir_readdir ( ) : string reads directory contents
dir_rewinddir ( ) : boolean reset directory iteration
getRoot ( ) : org\bovigo\vfs\vfsStreamContainer returns the root content
mkdir ( string $path, integer $mode, integer $options ) : boolean creates a new directory
register ( ) method to register the stream wrapper
rename ( string $path_from, string $path_to ) : boolean rename from one path to another
rmdir ( string $path, integer $options ) : boolean removes a directory
setQuota ( Quota $quota ) sets quota for disk space
setRoot ( org\bovigo\vfs\vfsStreamContainer $root ) : org\bovigo\vfs\vfsStreamContainer sets the root content
stream_cast ( integer $cast_as ) : boolean retrieve the underlaying resource
stream_close ( ) closes the stream
stream_eof ( ) : boolean checks whether stream is at end of file
stream_flush ( ) : boolean flushes unstored data into storage
stream_lock ( integer $operation ) : boolean set lock status for stream
stream_metadata ( string $path, integer $option, mixed $var ) : boolean sets metadata like owner, user or permissions
stream_open ( string $path, string $mode, string $options, string $opened_path ) : boolean open the stream
stream_read ( integer $count ) : string read the stream up to $count bytes
stream_seek ( integer $offset, integer $whence ) : boolean seeks to the given offset
stream_set_option ( integer $option, integer $arg1, integer $arg2 ) : boolean sets options on the stream
stream_stat ( ) : array returns status of stream
stream_tell ( ) : integer returns the current position of the stream
stream_truncate ( integer $size ) : boolean truncates a file to a given length
stream_write ( string $data ) : integer writes data into the stream
unlink ( string $path ) : boolean remove the data under the given path
unregister ( ) Unregisters a previously registered URL wrapper for the vfs scheme.
url_stat ( string $path, integer $flags ) : array returns status of url

보호된 메소드들

메소드 설명
calculateMode ( string $mode, boolean $extended ) : integer calculates the file mode
doUnlink ( string $path ) : boolean removes a path
getContent ( string $path ) : org\bovigo\vfs\vfsStreamContent returns content for given path
getContentOfType ( string $path, integer $type ) : org\bovigo\vfs\vfsStreamContent returns content for given path but only when it is of given type
resolvePath ( string $path ) : string helper method to resolve a path from /foo/bar/. to /foo/bar
splitPath ( string $path ) : string[] splits path into its dirname and the basename

비공개 메소드들

메소드 설명
createFile ( string $path, string $mode = null, string $options = null ) : boolean creates a file at given path
doPermChange ( string $path, vfsStreamAbstractContent $content, Closure $change ) : boolean executes given permission change when necessary rights allow such a change
isInRoot ( string $path ) : boolean helper method to detect whether given path is in root path

메소드 상세

calculateMode() 보호된 메소드

calculates the file mode
protected calculateMode ( string $mode, boolean $extended ) : integer
$mode string opening mode: r, w, a or x
$extended boolean true if + was set with opening mode
리턴 integer

dir_closedir() 공개 메소드

closes directory
public dir_closedir ( ) : boolean
리턴 boolean

dir_opendir() 공개 메소드

opens a directory
public dir_opendir ( string $path, integer $options ) : boolean
$path string
$options integer
리턴 boolean

dir_readdir() 공개 메소드

reads directory contents
public dir_readdir ( ) : string
리턴 string

dir_rewinddir() 공개 메소드

reset directory iteration
public dir_rewinddir ( ) : boolean
리턴 boolean

getContent() 보호된 메소드

returns content for given path
protected getContent ( string $path ) : org\bovigo\vfs\vfsStreamContent
$path string
리턴 org\bovigo\vfs\vfsStreamContent

getContentOfType() 보호된 메소드

returns content for given path but only when it is of given type
protected getContentOfType ( string $path, integer $type ) : org\bovigo\vfs\vfsStreamContent
$path string
$type integer
리턴 org\bovigo\vfs\vfsStreamContent

getRoot() 공개 정적인 메소드

returns the root content
public static getRoot ( ) : org\bovigo\vfs\vfsStreamContainer
리턴 org\bovigo\vfs\vfsStreamContainer

mkdir() 공개 메소드

creates a new directory
public mkdir ( string $path, integer $mode, integer $options ) : boolean
$path string
$mode integer
$options integer
리턴 boolean

register() 공개 정적인 메소드

Please be aware that a call to this method will reset the root element to null. If the stream is already registered the method returns silently. If there is already another stream wrapper registered for the scheme used by vfsStream a vfsStreamException will be thrown.
public static register ( )

rename() 공개 메소드

rename from one path to another
저자: Benoit Aubuchon
public rename ( string $path_from, string $path_to ) : boolean
$path_from string
$path_to string
리턴 boolean

resolvePath() 보호된 메소드

helper method to resolve a path from /foo/bar/. to /foo/bar
protected resolvePath ( string $path ) : string
$path string
리턴 string

rmdir() 공개 메소드

removes a directory
public rmdir ( string $path, integer $options ) : boolean
$path string
$options integer
리턴 boolean

setQuota() 공개 정적인 메소드

sets quota for disk space
부터: 1.1.0
public static setQuota ( Quota $quota )
$quota Quota

setRoot() 공개 정적인 메소드

sets the root content
public static setRoot ( org\bovigo\vfs\vfsStreamContainer $root ) : org\bovigo\vfs\vfsStreamContainer
$root org\bovigo\vfs\vfsStreamContainer
리턴 org\bovigo\vfs\vfsStreamContainer

splitPath() 보호된 메소드

splits path into its dirname and the basename
protected splitPath ( string $path ) : string[]
$path string
리턴 string[]

stream_cast() 공개 메소드

Please note that this method always returns false as there is no underlaying resource to return.
또한 보기: https://github.com/mikey179/vfsStream/issues/3
부터: 0.9.0
public stream_cast ( integer $cast_as ) : boolean
$cast_as integer
리턴 boolean

stream_close() 공개 메소드

closes the stream
또한 보기: https://github.com/mikey179/vfsStream/issues/40
public stream_close ( )

stream_eof() 공개 메소드

checks whether stream is at end of file
public stream_eof ( ) : boolean
리턴 boolean

stream_flush() 공개 메소드

flushes unstored data into storage
public stream_flush ( ) : boolean
리턴 boolean

stream_lock() 공개 메소드

set lock status for stream
또한 보기: https://github.com/mikey179/vfsStream/issues/6
또한 보기: https://github.com/mikey179/vfsStream/issues/31
또한 보기: https://github.com/mikey179/vfsStream/issues/40
부터: 0.10.0
public stream_lock ( integer $operation ) : boolean
$operation integer
리턴 boolean

stream_metadata() 공개 메소드

sets metadata like owner, user or permissions
부터: 1.1.0
public stream_metadata ( string $path, integer $option, mixed $var ) : boolean
$path string
$option integer
$var mixed
리턴 boolean

stream_open() 공개 메소드

open the stream
public stream_open ( string $path, string $mode, string $options, string $opened_path ) : boolean
$path string the path to open
$mode string mode for opening
$options string options for opening
$opened_path string full path that was actually opened
리턴 boolean

stream_read() 공개 메소드

read the stream up to $count bytes
public stream_read ( integer $count ) : string
$count integer amount of bytes to read
리턴 string

stream_seek() 공개 메소드

seeks to the given offset
public stream_seek ( integer $offset, integer $whence ) : boolean
$offset integer
$whence integer
리턴 boolean

stream_set_option() 공개 메소드

sets options on the stream
또한 보기: https://github.com/mikey179/vfsStream/issues/15
또한 보기: http://www.php.net/manual/streamwrapper.stream-set-option.php
부터: 0.10.0
public stream_set_option ( integer $option, integer $arg1, integer $arg2 ) : boolean
$option integer key of option to set
$arg1 integer
$arg2 integer
리턴 boolean

stream_stat() 공개 메소드

returns status of stream
public stream_stat ( ) : array
리턴 array

stream_tell() 공개 메소드

returns the current position of the stream
public stream_tell ( ) : integer
리턴 integer

stream_truncate() 공개 메소드

truncates a file to a given length
부터: 1.1.0
public stream_truncate ( integer $size ) : boolean
$size integer length to truncate file to
리턴 boolean

stream_write() 공개 메소드

writes data into the stream
public stream_write ( string $data ) : integer
$data string
리턴 integer amount of bytes written

unregister() 공개 정적인 메소드

If this stream wrapper wasn't registered, the method returns silently. If unregistering fails, or if the URL wrapper for vfs:// was not registered with this class, a vfsStreamException will be thrown.
부터: 1.6.0
public static unregister ( )

url_stat() 공개 메소드

returns status of url
public url_stat ( string $path, integer $flags ) : array
$path string path of url to return status for
$flags integer flags set by the stream API
리턴 array

프로퍼티 상세

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

shortcut to file container
protected $content

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

shortcut to directory container
protected $dir

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

shortcut to directory container iterator
protected $dirIterator

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

file mode: read only, write only, all
protected $mode

$registered 보호되어 있는 정적으로 프로퍼티

switch whether class has already been registered as stream wrapper or not
protected static $registered

$root 보호되어 있는 정적으로 프로퍼티

root content
protected static $root