# 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
jump to top

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

`string LINES_KEY = 'lines'`

Parameter name for the number of lines to be returned.

  string

### Properties

`array $_lineBuffer= 'array'`

Array to hold lines.

Default value `array` Details

Type
  array

`integer $_lines= '10'`

Number of lines to be returned in the filtered stream.

Default value `10` Details

Type
  integer

### Methods

`_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.
`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 |

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

Type | Description
--- | ---
integer |

`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 |

`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.