classes/phing/filters/HeadFilter.php

\HeadFilter

Reads the first <code>n</code> lines of a stream.

(Default is first 10 lines.)

<

p> Example:

Or:


   
Extends from
\BaseParamFilterReader
Implements
\ChainableReader
see
\FilterReader
access
public
author
Yannick Lecaillez
author
hans lellelid, hans@velum.net
copyright
© 2003 seasonfive. All rights reserved
package
phing.filters
version
$Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Constants

Constant  LINES_KEY = 'lines'

Parameter name for the number of lines to be returned.

Properties

Propertyprivateinteger  $_lines= '10'

Number of lines to be returned in the filtered stream.

Default value10Details
Type
integer
Propertyprivateinteger  $_linesRead= '0'

Number of lines currently read in.

Default value0Details
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 HeadFilter 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(  $len = null ) : \the
Returns first n lines of stream.
Parameters
Name Type Description
$len
Returns
Type Description
\the
Details
exception
IOException if the underlying stream throws an IOException during reading
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.