PHP Class HeadFilter, symfony-1.4

(Default is first 10 lines.)

Example:

Or:

   
See also: FilterReader
Author: hans lellelid, [email protected]
Inheritance: extends BaseParamFilterReader, implements ChainableReader
Exibir arquivo Open project: vjousse/symfony-1.4 Class Usage Examples

Public Methods

Method Description
chain ( Reader $reader ) : object Creates a new HeadFilter using the passed in Reader for instantiation.
getLines ( ) : integer Returns the number of lines to be returned in the filtered stream.
read ( $len = null ) : the Returns first n lines of stream.
setLines ( integer $lines ) Sets the number of lines to be returned in the filtered stream.

Private Methods

Method Description
_initialize ( ) Scans the parameters list for the "lines" parameter and uses it to set the number of lines to be returned in the filtered stream.

Method Details

chain() public method

Creates a new HeadFilter using the passed in Reader for instantiation.
public chain ( Reader $reader ) : object
$reader Reader
return object A new filter based on this configuration, but filtering the specified reader.

getLines() public method

Returns the number of lines to be returned in the filtered stream.
public getLines ( ) : integer
return integer The number of lines to be returned in the filtered stream.

read() public method

Returns first n lines of stream.
public read ( $len = null ) : the
return the resulting stream, or -1 if the end of the resulting stream has been reached

setLines() public method

Sets the number of lines to be returned in the filtered stream.
public setLines ( integer $lines )
$lines integer the number of lines to be returned in the filtered stream.