PHP 클래스 TQ\Vcs\StreamWrapper\AbstractStreamWrapper

파일 보기 프로젝트 열기: teqneers/php-stream-wrapper-for-git 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$context resource The stream context if set

보호된 프로퍼티들

프로퍼티 타입 설명
$bufferFactory TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface The buffer factory
$contextOptions array The parsed stream context options
$contextParameters array The parsed stream context parameters
$dirBuffer TQ\Vcs\Buffer\ArrayBuffer The directory buffer if used on a directory
$fileBuffer TQ\Vcs\Buffer\FileBufferInterface The file buffer if used on a file
$path TQ\Vcs\StreamWrapper\PathInformationInterface The opened path
$pathFactory PathFactoryInterface The path factory
$protocol string The registered protocol

공개 메소드들

메소드 설명
dir_closedir ( ) : boolean streamWrapper::dir_closedir — Close directory handle
dir_opendir ( string $path, integer $options ) : boolean streamWrapper::dir_opendir — Open directory handle
dir_readdir ( ) : string | false streamWrapper::dir_readdir — Read entry from directory handle
dir_rewinddir ( ) : boolean streamWrapper::dir_rewinddir — Rewind directory handle
getRepositoryRegistry ( ) : RepositoryRegistry Returns the repository registry
mkdir ( string $path, integer $mode, integer $options ) : boolean streamWrapper::mkdir — Create a directory
rename ( string $path_from, string $path_to ) : boolean streamWrapper::rename — Renames a file or directory
rmdir ( string $path, integer $options ) : boolean streamWrapper::rmdir — Removes a directory
stream_close ( ) streamWrapper::stream_close — Close an resource
stream_eof ( ) : boolean streamWrapper::stream_eof — Tests for end-of-file on a file pointer
stream_flush ( ) : boolean streamWrapper::stream_flush — Flushes the output
stream_open ( string $path, string $mode, integer $options, string &$opened_path ) : boolean streamWrapper::stream_open — Opens file or URL
stream_read ( integer $count ) : string streamWrapper::stream_read — Read from stream
stream_seek ( integer $offset, integer $whence = SEEK_SET ) : boolean streamWrapper::stream_seek — Seeks to specific location in a stream
stream_stat ( ) : array streamWrapper::stream_stat — Retrieve information about a file resource
stream_tell ( ) : integer streamWrapper::stream_tell — Retrieve the current position of a stream
stream_write ( string $data ) : integer streamWrapper::stream_write — Write to stream
unlink ( string $path ) : boolean streamWrapper::unlink — Delete a file
unregister ( ) Unregisters the stream wrapper
url_stat ( string $path, integer $flags ) : array streamWrapper::url_stat — Retrieve information about a file

보호된 메소드들

메소드 설명
doRegister ( string $protocol, PathFactoryInterface $pathFactory, TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface $bufferFactory ) Registers the stream wrapper with the given protocol
getBufferFactory ( ) : TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface Creates the buffer factory
getContextOption ( string $option, mixed $default = null ) : mixed Returns a context option - $default if option is not found
getContextOptions ( boolean $all = false ) : array Parses the passed stream context and returns the context options relevant for this stream wrapper
getContextParameter ( string $parameter, mixed $default = null ) : mixed Returns a context parameter - $default if parameter is not found
getContextParameters ( ) : array Parses the passed stream context and returns the context parameters
getPath ( string $streamUrl ) : TQ\Vcs\StreamWrapper\PathInformationInterface Returns the path information for a given stream URL
maskHasFlag ( integer $mask, integer $flag ) : boolean Checks if a bitmask has a specific flag set

메소드 상세

dir_closedir() 공개 메소드

streamWrapper::dir_closedir — Close directory handle
public dir_closedir ( ) : boolean
리턴 boolean Returns TRUE on success or FALSE on failure.

dir_opendir() 공개 메소드

streamWrapper::dir_opendir — Open directory handle
public dir_opendir ( string $path, integer $options ) : boolean
$path string Specifies the URL that was passed to {@see \opendir()}.
$options integer Whether or not to enforce safe_mode (0x04).
리턴 boolean Returns TRUE on success or FALSE on failure.

dir_readdir() 공개 메소드

streamWrapper::dir_readdir — Read entry from directory handle
public dir_readdir ( ) : string | false
리턴 string | false Should return string representing the next filename, or FALSE if there is no next file.

dir_rewinddir() 공개 메소드

streamWrapper::dir_rewinddir — Rewind directory handle
public dir_rewinddir ( ) : boolean
리턴 boolean Returns TRUE on success or FALSE on failure.

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

Registers the stream wrapper with the given protocol
protected static doRegister ( string $protocol, PathFactoryInterface $pathFactory, TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface $bufferFactory )
$protocol string The protocol (such as "vcs")
$pathFactory PathFactoryInterface The path factory
$bufferFactory TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface The buffer factory

getBufferFactory() 보호된 메소드

Creates the buffer factory
protected getBufferFactory ( ) : TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface
리턴 TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface

getContextOption() 보호된 메소드

Returns a context option - $default if option is not found
protected getContextOption ( string $option, mixed $default = null ) : mixed
$option string The option to retrieve
$default mixed The default value if $option is not found
리턴 mixed

getContextOptions() 보호된 메소드

Parses the passed stream context and returns the context options relevant for this stream wrapper
protected getContextOptions ( boolean $all = false ) : array
$all boolean Return all options instead of just the relevant options
리턴 array The context options

getContextParameter() 보호된 메소드

Returns a context parameter - $default if parameter is not found
protected getContextParameter ( string $parameter, mixed $default = null ) : mixed
$parameter string The parameter to retrieve
$default mixed The default value if $parameter is not found
리턴 mixed

getContextParameters() 보호된 메소드

Parses the passed stream context and returns the context parameters
protected getContextParameters ( ) : array
리턴 array The context parameters

getPath() 보호된 메소드

Returns the path information for a given stream URL
protected getPath ( string $streamUrl ) : TQ\Vcs\StreamWrapper\PathInformationInterface
$streamUrl string The URL given to the stream function
리턴 TQ\Vcs\StreamWrapper\PathInformationInterface The path information representing the stream URL

getRepositoryRegistry() 공개 정적인 메소드

Returns the repository registry
public static getRepositoryRegistry ( ) : RepositoryRegistry
리턴 RepositoryRegistry

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

Checks if a bitmask has a specific flag set
protected static maskHasFlag ( integer $mask, integer $flag ) : boolean
$mask integer The bitmask
$flag integer The flag to check
리턴 boolean

mkdir() 공개 메소드

streamWrapper::mkdir — Create a directory
public mkdir ( string $path, integer $mode, integer $options ) : boolean
$path string Directory which should be created.
$mode integer The value passed to {@see \mkdir()}.
$options integer A bitwise mask of values, such as STREAM_MKDIR_RECURSIVE.
리턴 boolean Returns TRUE on success or FALSE on failure.

rename() 공개 메소드

streamWrapper::rename — Renames a file or directory
public rename ( string $path_from, string $path_to ) : boolean
$path_from string The URL to the current file.
$path_to string The URL which the $path_from should be renamed to.
리턴 boolean Returns TRUE on success or FALSE on failure.

rmdir() 공개 메소드

streamWrapper::rmdir — Removes a directory
public rmdir ( string $path, integer $options ) : boolean
$path string The directory URL which should be removed.
$options integer A bitwise mask of values, such as STREAM_MKDIR_RECURSIVE.
리턴 boolean Returns TRUE on success or FALSE on failure.

stream_close() 공개 메소드

streamWrapper::stream_close — Close an resource
public stream_close ( )

stream_eof() 공개 메소드

streamWrapper::stream_eof — Tests for end-of-file on a file pointer
public stream_eof ( ) : boolean
리턴 boolean Should return TRUE if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise.

stream_flush() 공개 메소드

streamWrapper::stream_flush — Flushes the output
public stream_flush ( ) : boolean
리턴 boolean Should return TRUE if the cached data was successfully stored (or if there was no data to store), or FALSE if the data could not be stored.

stream_open() 공개 메소드

streamWrapper::stream_open — Opens file or URL
public stream_open ( string $path, string $mode, integer $options, string &$opened_path ) : boolean
$path string Specifies the URL that was passed to the original function.
$mode string The mode used to open the file, as detailed for fopen().
$options integer Holds additional flags set by the streams API. It can hold one or more of the following values OR'd together. STREAM_USE_PATH If path is relative, search for the resource using the include_path. STREAM_REPORT_ERRORS If this flag is set, you are responsible for raising errors using trigger_error() during opening of the stream. If this flag is not set, you should not raise any errors.
$opened_path string If the path is opened successfully, and STREAM_USE_PATH is set in options, opened_path should be set to the full path of the file/resource that was actually opened.
리턴 boolean Returns TRUE on success or FALSE on failure.

stream_read() 공개 메소드

streamWrapper::stream_read — Read from stream
public stream_read ( integer $count ) : string
$count integer How many bytes of data from the current position should be returned.
리턴 string If there are less than count bytes available, return as many as are available. If no more data is available, return either FALSE or an empty string.

stream_seek() 공개 메소드

streamWrapper::stream_seek — Seeks to specific location in a stream
public stream_seek ( integer $offset, integer $whence = SEEK_SET ) : boolean
$offset integer The stream offset to seek to.
$whence integer Possible values: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset.
리턴 boolean Return TRUE if the position was updated, FALSE otherwise.

stream_stat() 공개 메소드

streamWrapper::stream_stat — Retrieve information about a file resource
public stream_stat ( ) : array
리턴 array stat() and fstat() result format Numeric Associative (since PHP 4.0.6) Description 0 dev device number 1 ino inode number * 2 mode inode protection mode 3 nlink number of links 4 uid userid of owner * 5 gid groupid of owner * 6 rdev device type, if inode device 7 size size in bytes 8 atime time of last access (Unix timestamp) 9 mtime time of last modification (Unix timestamp) 10 ctime time of last inode change (Unix timestamp) 11 blksize blocksize of filesystem IO ** 12 blocks number of 512-byte blocks allocated ** * On Windows this will always be 0. ** Only valid on systems supporting the st_blksize type - other systems (e.g. Windows) return -1.

stream_tell() 공개 메소드

streamWrapper::stream_tell — Retrieve the current position of a stream
public stream_tell ( ) : integer
리턴 integer Should return the current position of the stream.

stream_write() 공개 메소드

streamWrapper::stream_write — Write to stream
public stream_write ( string $data ) : integer
$data string Should be stored into the underlying stream.
리턴 integer Should return the number of bytes that were successfully stored, or 0 if none could be stored.

unregister() 공개 정적인 메소드

Unregisters the stream wrapper
public static unregister ( )

url_stat() 공개 메소드

mode bit mask: S_IFMT 0170000 bit mask for the file type bit fields S_IFSOCK 0140000 socket S_IFLNK 0120000 symbolic link S_IFREG 0100000 regular file S_IFBLK 0060000 block device S_IFDIR 0040000 directory S_IFCHR 0020000 character device S_IFIFO 0010000 FIFO S_ISUID 0004000 set UID bit S_ISGID 0002000 set-group-ID bit (see below) S_ISVTX 0001000 sticky bit (see below) S_IRWXU 00700 mask for file owner permissions S_IRUSR 00400 owner has read permission S_IWUSR 00200 owner has write permission S_IXUSR 00100 owner has execute permission S_IRWXG 00070 mask for group permissions S_IRGRP 00040 group has read permission S_IWGRP 00020 group has write permission S_IXGRP 00010 group has execute permission S_IRWXO 00007 mask for permissions for others (not in group) S_IROTH 00004 others have read permission S_IWOTH 00002 others have write permission S_IXOTH 00001 others have execute permission
public url_stat ( string $path, integer $flags ) : array
$path string The file path or URL to stat. Note that in the case of a URL, it must be a :// delimited URL. Other URL forms are not supported.
$flags integer Holds additional flags set by the streams API. It can hold one or more of the following values OR'd together. STREAM_URL_STAT_LINK For resources with the ability to link to other resource (such as an HTTP Location: forward, or a filesystem symlink). This flag specified that only information about the link itself should be returned, not the resource pointed to by the link. This flag is set in response to calls to lstat(), is_link(), or filetype(). STREAM_URL_STAT_QUIET If this flag is set, your wrapper should not raise any errors. If this flag is not set, you are responsible for reporting errors using the trigger_error() function during stating of the path.
리턴 array Should return as many elements as stat() does. Unknown or unavailable values should be set to a rational value (usually 0).

프로퍼티 상세

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

The buffer factory
protected static FactoryInterface,TQ\Vcs\StreamWrapper\FileBuffer $bufferFactory
리턴 TQ\Vcs\StreamWrapper\FileBuffer\FactoryInterface

$context 공개적으로 프로퍼티

The stream context if set
public resource $context
리턴 resource

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

The parsed stream context options
protected array $contextOptions
리턴 array

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

The parsed stream context parameters
protected array $contextParameters
리턴 array

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

The directory buffer if used on a directory
protected ArrayBuffer,TQ\Vcs\Buffer $dirBuffer
리턴 TQ\Vcs\Buffer\ArrayBuffer

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

The file buffer if used on a file
protected FileBufferInterface,TQ\Vcs\Buffer $fileBuffer
리턴 TQ\Vcs\Buffer\FileBufferInterface

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

The opened path
protected PathInformationInterface,TQ\Vcs\StreamWrapper $path
리턴 TQ\Vcs\StreamWrapper\PathInformationInterface

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

The path factory
protected static PathFactoryInterface $pathFactory
리턴 PathFactoryInterface

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

The registered protocol
protected static string $protocol
리턴 string