PHP Class Tale\Jade\Renderer\Adapter\Stream\Wrapper

显示文件 Open project: talesoft/tale-jade Class Usage Examples

Public Methods

Method Description
isRegistered ( string $name ) : boolean Checks if a stream wrapper with the given scheme/name is registered.
register ( string $name ) Registers this class a a stream wrapper with the given scheme/name.
stream_eof ( ) : boolean Gets called when someone calls something like feof on this stream.
stream_open ( string $uri, string $mode, integer $options, &$opened_path ) : boolean This gets called when a url-stream is opened with the wrapper-scheme.
stream_read ( integer $length ) : string This gets called when anything tries to read from this.
stream_stat ( ) : array This gets called when someone calls fstat on this stream.
stream_tell ( ) : integer Gets called when someone calls something like ftell on this stream.
unregister ( string $name ) Unregisters the stream wrapper with the given scheme/name.

Method Details

isRegistered() public static method

Checks if a stream wrapper with the given scheme/name is registered.
See also: stream_get_wrappers
public static isRegistered ( string $name ) : boolean
$name string The scheme/name of the stream wrapper
return boolean

register() public static method

Registers this class a a stream wrapper with the given scheme/name.
See also: stream_wrapper_register
public static register ( string $name )
$name string The scheme/name this wrapper should react on

stream_eof() public method

Returns true, if the stream is at the end of data or false, if there's still PHTML left to read
public stream_eof ( ) : boolean
return boolean

stream_open() public method

(e.g. fopen('tale-jade://data;...'), INCLUDE('tale-jade://data;...')
public stream_open ( string $uri, string $mode, integer $options, &$opened_path ) : boolean
$uri string the Data-URI this stream was opened with
$mode string the stream read/write-mode (useless here)
$options integer the flags for this stream instance (useless here)
return boolean

stream_read() public method

(opened) stream (e.g. fread, fgets, fgetcsv, INCLUDE(!!!) etc.) We return the fitting chunk of our PHTML and add that length of that to our current position so that the next call will read the next chunk, rinse and repeat
public stream_read ( integer $length ) : string
$length integer the length of the chunk to read
return string

stream_stat() public method

It's a requirement to define stream_stat() for some functions We just return an empty array
public stream_stat ( ) : array
return array

stream_tell() public method

Returns the current position in our stream
public stream_tell ( ) : integer
return integer

unregister() public static method

Unregisters the stream wrapper with the given scheme/name.
See also: stream_wrapper_unregister
public static unregister ( string $name )
$name string The scheme/name of the stream wrapper to be unregistered