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
Afficher le fichier Open project: vjousse/symfony-1.4 Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

getLines() public méthode

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

read() public méthode

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

setLines() public méthode

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.