PHP Class TestFileSystemStream

Author: Jaroslav HanslĂ­k
Show file Open project: jyxo/php Class Usage Examples

Public Methods

Method Description
register ( string $protocol ) : boolean Registers a protocol.
setError ( integer $error ) Sets error type.
stream_close ( ) : boolean Closes a file.
stream_eof ( ) : boolean Returns if the pointer is at the end of the file.
stream_open ( string $path, string $mode, integer $options, string &$openedPath ) : boolean Opens a file.
stream_read ( integer $length ) : string Reads from a file.
stream_stat ( ) : array Retrieves information about a file.
stream_write ( string $data ) : integer Writes into a file.
unlink ( string $path ) : boolean Deletes a file.
unregister ( string $protocol ) : boolean Unregisters a protocol.

Method Details

register() public static method

Registers a protocol.
public static register ( string $protocol ) : boolean
$protocol string Protocol name
return boolean

setError() public static method

Sets error type.
public static setError ( integer $error )
$error integer Error type

stream_close() public method

Closes a file.
public stream_close ( ) : boolean
return boolean

stream_eof() public method

Returns if the pointer is at the end of the file.
public stream_eof ( ) : boolean
return boolean

stream_open() public method

Opens a file.
public stream_open ( string $path, string $mode, integer $options, string &$openedPath ) : boolean
$path string File path
$mode string Open mode
$options integer Additional options
$openedPath string Opened file path
return boolean

stream_read() public method

Reads from a file.
public stream_read ( integer $length ) : string
$length integer Read length
return string

stream_stat() public method

Retrieves information about a file.
public stream_stat ( ) : array
return array

stream_write() public method

Writes into a file.
public stream_write ( string $data ) : integer
$data string Data to be written
return integer Number of bytes written

unregister() public static method

Unregisters a protocol.
public static unregister ( string $protocol ) : boolean
$protocol string Protocol name
return boolean