# 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

Package: phing\filters

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

Example:

Or:

Implements
  \ChainableReader
Parent(s)
  \BaseParamFilterReader < \BaseFilterReader < \FilterReader < \Reader
See
  \BaseParamFilterReader
Author
  Yannick Lecaillez
Author
  hans lellelid, hans@velum.net
Copyright
  © 2003 seasonfive. All rights reserved
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

`__construct( ) : void`

`_initialize( ) : void`

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 | A new filter based on this configuration, but filtering the specified reader.

`close( ) : void`

`eof( ) : void`

`getInitialized( ) : void`

`getLines( ) : integer`

Returns the number of lines to be returned in the filtered stream.

Returns

Type | Description
--- | ---
integer | The number of lines to be returned in the filtered stream.

`getParameters( ) : void`

`getProject( ) : void`

`getResource( ) : void`

`log( ) : void`

`mark( ) : void`

`markSupported( ) : void`

`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 | The filtered buffer or -1 if EOF.

`readLine( ) : void`

`ready( ) : void`

`reset( ) : void`

`setInitialized( ) : void`

`setLines( integer $lines ) : void`

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.

`setParameters( ) : void`

`setProject( ) : void`

`setReader( ) : void`

`skip( ) : void`

Documentation was generated by DocBlox 0.17.1.