phing-filters

# Class: ReplaceRegexp Source Location: /filters/ReplaceRegexp.php
### Class Overview
    Reader
       |
       --FilterReader
          |
          --BaseFilterReader
             |
             --ReplaceRegexp
Performs a regexp find/replace on stream. #### Author(s): Hans Lellelid <hans@xmpl.org> #### Version: $Revision: 526 $ Implements interfaces: ChainableReader | ### Methods chain createRegexp getRegexps read setRegexps
### Inherited Variables #### Class: BaseFilterReader BaseFilterReader::$initialized BaseFilterReader::$project #### Class: FilterReader FilterReader::$in | ### Inherited Methods #### Class: BaseFilterReader BaseFilterReader::__construct() Constructor used by Phing's introspection mechanism. BaseFilterReader::eof() Returns whether the end of file has been reached with input stream. BaseFilterReader::getInitialized() Returns the initialized status. BaseFilterReader::getProject() Returns the project this filter is part of. BaseFilterReader::log() Convenience method to support logging in filters. BaseFilterReader::read() Reads characters. BaseFilterReader::readLine() Reads a line of text ending with '\n' (or until the end of the stream). BaseFilterReader::setInitialized() Sets the initialized status. BaseFilterReader::setProject() Sets the project to work with. #### Class: FilterReader FilterReader::__construct() FilterReader::close() FilterReader::getResource() FilterReader::read() Read data from source. FilterReader::reset() FilterReader::setReader() FilterReader::skip() #### Class: Reader Reader::close() Close stream. Reader::getResource() Returns the filename, url, etc. that is being read from. Reader::mark() If supported, places a "marker" (like a bookmark) at current stream position. Reader::markSupported() Whether marking is supported. Reader::read() Read data from source. Reader::ready() Is stream ready for reading. Reader::reset() Reset the current position in stream to beginning or last mark (if supported). Reader::skip() Move stream position relative to current pos.
### Class Details [line 42] Performs a regexp find/replace on stream. Example:
#### Tags:
author: | Hans Lellelid <hans@xmpl.org>
version: | $Revision: 526 $
[ Top ] ### Class Methods ### method chain [line 120]
`ReplaceRegExp chain( $reader)`
Creates a new ReplaceRegExp filter using the passed in Reader for instantiation. #### Tags:
return: | A new filter based on this configuration, but filtering the specified reader
Implementation of: ChainableReader::chain() Returns a reader with the same configuration as this one, but filtering input from the specified reader. #### Parameters:
Reader | $reader | A Reader object providing the underlying stream. Must not be null .
[ Top ] ### method createRegexp [line 53]
`RegularExpression createRegexp( )`
Creator method handles nested <regexp> tags. [ Top ] ### method getRegexps [line 72]
`array getRegexps( )`
Gets the current regexps. (Used when, e.g., cloning/chaining the method.) #### Tags:
return: | RegularExpression[]
[ Top ] ### method read [line 87]
`mixed read( [int $len = null])`
Returns the filtered stream. The original stream is first read in fully, and the regex replace is performed. #### Tags:
return: | The filtered stream, or -1 if the end of the resulting stream has been reached.
exception: | IOException if the underlying stream throws an IOException during reading
Overrides BaseFilterReader::read() (Reads characters.) #### Parameters:
int | $len | Required $len for Reader compliance.
[ Top ] ### method setRegexps [line 63]
`void setRegexps( array $regexps)`
Sets the current regexps. (Used when, e.g., cloning/chaining the method.) #### Parameters:
array | $regexps | RegularExpression[]
[ Top ] Documentation generated on Mon, 19 Oct 2009 10:51:54 +0200 by phpDocumentor 1.4.3