classes/phing/filters/TailFilter.php

Reads the last <code>n</code> lines of a stream. (Default is last10 lines.)

Example:

Or:


  
author
Yannick Lecaillez
author
hans lellelid, hans@velum.net
copyright
© 2003 seasonfive. All rights reserved
package
phing.filters
see
\BaseParamFilterReader
version
$Revision: 526 $

\TailFilter

Reads the last <code>n</code> lines of a stream. (Default is last10 lines.)

Example:

Or:


  
Extends from
\BaseParamFilterReader
Implements
\ChainableReader
see
\BaseParamFilterReader
author
Yannick Lecaillez
author
hans lellelid, hans@velum.net
copyright
© 2003 seasonfive. All rights reserved
package
phing.filters
version
$Revision: 526 $

Constants

Constantstring  LINES_KEY = 'lines'

Parameter name for the number of lines to be returned.

string

Properties

Propertyprivatearray  $_lineBuffer= 'array'

Array to hold lines.

Default valuearrayDetails
Type
array
Propertyprivateinteger  $_lines= '10'

Number of lines to be returned in the filtered stream.

Default value10Details
Type
integer

Methods

methodprivate  _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.
methodpublic  chain( object $reader ) : object
Creates a new TailFilter using the passed in Reader for instantiation.
Parameters
Name Type Description
$reader object

A Reader object providing the underlying stream. Must not be null.

Returns
Type Description
object
methodpublic  getLines( ) : integer
Returns the number of lines to be returned in the filtered stream.
Returns
Type Description
integer
methodpublic  read( int $len = null ) : mixed
Returns the last n lines of a file.
Parameters
Name Type Description
$len int Num chars to read.
Returns
Type Description
mixed
methodpublic  setLines( integer $lines ) :
Sets the number of lines to be returned in the filtered stream.
Parameters
Name Type Description
$lines integer the number of lines to be returned in the filtered stream.
Documentation was generated by DocBlox 0.13.1.