TailFilter

Extends \BaseParamFilterReader Implements \ChainableReader

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

Example:

Or:


  
author

Yannick Lecaillez

author

hans lellelid, [email protected]

copyright

2003 seasonfive. All rights reserved

see
package

phing.filters

Methods

__construct

__construct(\Reader $in = null) 
inherited

Arguments

$in

\Reader

Creates a new TailFilter using the passed in Reader for instantiation.

chain(\Reader $reader) : \TailFilter

Arguments

$reader

\Reader

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

Response

\TailFilter

A new filter based on this configuration, but filtering the specified reader.

Close stream.

close() 
inherited abstract
Throws
\IOException

if there is an error closing stream

Returns whether the end of file has been reached with input stream.

eof() : boolean
inherited

Response

boolean

Returns the initialized status.

getInitialized() : boolean
inherited

Response

boolean

whether or not the filter is initialized

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

getLines() : integer

Response

integer

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

Returns the parameters to be used by this filter.

getParameters() : array
inherited

Response

array

the parameters to be used by this filter

Returns the project this filter is part of.

getProject() : object
inherited

Response

object

The project this filter is part of

Returns the filename, url, etc. that is being read from.

getResource() : string
inherited abstract

This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.

Response

string

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

getSkip() : integer

Response

integer

the number of lines to be skipped in the filtered stream

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

initialize() 

Convenience method to support logging in filters.

log(string $msg, integer $level = \Project::MSG_INFO) : void
inherited

Arguments

$msg

string

Message to log.

$level

integer

Priority level.

If supported, places a "marker" (like a bookmark) at current stream position.

mark() 
inherited

A subsequent call to reset() will move stream position back to last marker (if supported).

Whether marking is supported.

markSupported() : boolean
inherited

Response

boolean

Read data from source.

read(integer $len = null) 
inherited abstract

If length is specified, then only that number of chars is read, otherwise stream is read until EOF.

Arguments

$len

integer

Reads a line of text ending with '\n' (or until the end of the stream).

readLine() : string
inherited

The returned String retains the '\n'.

Throws
\IOException

if the underlying reader throws one during reading

Response

string

the line read, or null if the end of the stream has already been reached

Is stream ready for reading.

ready() : boolean
inherited

Response

boolean

Reset the current position in stream to beginning or last mark (if supported).

reset() 
inherited

Sets the initialized status.

setInitialized(boolean $initialized) 
inherited

Arguments

$initialized

boolean

Whether or not the filter is initialized.

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

setLines(integer $lines) 

Arguments

$lines

integer

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

Sets the parameters used by this filter, and sets the filter to an uninitialized status.

setParameters(array $parameters) : void
inherited
Throws
\Exception

Arguments

$parameters

array

Array of parameters to be used by this filter. Should not be null.

Sets the project to work with.

setProject(object|\Project $project) 
inherited

Arguments

$project

object|\Project

The project this filter is part of. Should not be null.

setReader

setReader(\Reader $in) 
inherited

Arguments

$in

\Reader

Sets the number of lines to be skipped in the filtered stream.

setSkip(integer $skip) 

Arguments

$skip

integer

the number of lines to be skipped in the filtered stream

Move stream position relative to current pos.

skip(integer $n) 
inherited

Arguments

$n

integer

Constants

Parameter name for the number of lines to be returned.

LINES_KEY
var

Parameter name for the number of lines to be skipped.

SKIP_KEY

Properties

Number of lines to be returned in the filtered stream.

lines : integer
var

Type(s)

integer

Array to hold lines.

lineBuffer : array
var

Type(s)

array

Number of lines to be skipped.

skip : 

Type(s)

The passed in parameter array.

_parameters : array
inherited
var

Type(s)

array

Have the parameters passed been interpreted?

initialized : 
inherited

Type(s)

The Phing project this filter is part of.

project : \Project
inherited
var

Type(s)

\Project

in

in : \Reader
inherited
var

Type(s)

\Reader