Classes, interfaces and traits

ChainableReader

Interface indicating that a reader may be chained to another one.

« More »

XincludeFilter

Applies Xinclude parsing to incoming text.

Uses PHP DOM XML support
« More »

TailFilter

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

Example: <pre><tailfilter lines="3" /></pre> Or: <pre><filterreader classname="phing.filters.TailFilter"> <param name="lines" value="3"> </filterreader></pre>
« More »

TranslateGettext

Replaces gettext("message id") and _("message id") with the translated string.

Gettext is great for creating multi-lingual sites, but in some cases (e.g. for performance reasons) you may wish to replace the gettext calls with the translations of the strings; that's what this task is for. Note that this is similar to ReplaceTokens, but both the find and the replace aspect is more complicated -- hence this is a separate, stand-alone filter. <p> Example:<br> <pre> <translategettext locale="en_US" domain="messages" dir="${webroot}/local"/> </pre>
« More »

BaseFilterReader

Base class for core filter readers.

« More »

StripPhpComments

This is a Php comment and string stripper reader that filters those lexical tokens out for purposes of simple Php parsing.

(if you have more complex Php parsing needs, use a real lexer). Since this class heavily relies on the single char read function, you are reccomended to make it work on top of a buffered reader.
« More »

ExpandProperties

Expands Phing Properties, if any, in the data.

<p> Example:<br> <pre><expandproperties/></pre> Or: <pre><filterreader classname="phing.filters.ExpandProperties'/></pre>
« More »

BaseParamFilterReader

Base class for core filter readers.

« More »

IconvFilter

Encode data from <code>in</code> encoding to <code>out</code> encoding.

Example: <pre> <iconvfilter inputencoding="UTF-8" outputencoding="CP1251" /> </pre> Or: <pre> <filterreader classname="phing.filters.IconvFilter"> <param name="inputencoding" value="UTF-8" /> <param name="outputencoding" value="CP1251" /> </filterreader> </pre>
« More »

TabToSpaces

Converts tabs to spaces.

Example: <pre><tabtospaces tablength="8"></pre> Or: <pre><filterreader classname="phing.filters.TabsToSpaces"> <param name="tablength" value="8"> </filterreader></pre>
« More »

LineContainsRegexp

Filter which includes only those lines that contain the user-specified regular expression matching strings.

Example: <pre><linecontainsregexp> <regexp pattern="foo*"> </linecontainsregexp></pre> Or: <pre><filterreader classname="phing.filters.LineContainsRegExp"> <param type="regexp" value="foo*"/> </filterreader></pre> This will fetch all those lines that contain the pattern <code>foo</code>
« More »

HeadFilter

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

(Default is first 10 lines.) <p> Example: <pre><headfilter lines="3"/></pre> Or: <pre><filterreader classname="phing.filters.HeadFilter"> <param name="lines" value="3"/> </filterreader></pre>
« More »

LineContains

Filter which includes only those lines that contain all the user-specified strings.

Example: <pre><linecontains> <contains value="foo"> <contains value="bar"> </linecontains></pre> Or: <pre><filterreader classname="phing.filters.LineContains"> <param type="contains" value="foo"/> <param type="contains" value="bar"/> </filterreader></pre> This will include only those lines that contain <code>foo</code> and <code>bar</code>.
« More »

Contains

Holds a contains element.

« More »

ReplaceTokensWithFile

Replaces tokens in the original input with the contents of a file.

The file to be used is controlled by the name of the token which corresponds to the basename of the file to be used together with the optional pre and postfix strings that is possible to set. By default all HTML entities in the file is replaced by the corresponding HTML entities. This behaviour can be controlled by the "translatehtml" parameter. Supported parameters are: <pre> prefix string Text to be prefixed to token before using as filename postfix string Text to be prefixed to token before using as filename dir string The directory where the files should be read from translatehtml bool If we should translate all HTML entities in the file. </pre> Example: <pre><filterreader classname="phing.filters.ReplaceTokensWithFile"> <param name="dir" value="examples/" /> <param name="postfix" value=".php" /> </filterreader></pre>
« More »

StripLineComments

This filter strips line comments.

Example: <pre><striplinecomments> <comment value="#"/> <comment value="--"/> <comment value="REM "/> <comment value="rem "/> <comment value="//"/> </striplinecomments></pre> Or: <pre><filterreader classname="phing.filters.StripLineComments"> <param type="comment" value="#"/> <param type="comment" value="--"/> <param type="comment" value="REM "/> <param type="comment" value="rem "/> <param type="comment" value="//"/> </filterreader></pre>
« More »

Comment

The class that holds a comment representation.

« More »

PrefixLines

Attaches a prefix to every line.

Example: <pre><prefixlines prefix="Foo"/></pre> Or: <pre><filterreader classname="phing.filters.PrefixLines"> <param name="prefix" value="Foo"/> </filterreader></pre>
« More »

StripLineBreaks

Filter to flatten the stream to a single line.

Example: <pre><striplinebreaks/></pre> Or: <pre><filterreader classname="phing.filters.StripLineBreaks"/></pre>
« More »

XsltFilter

Applies XSL stylesheet to incoming text.

Uses PHP XSLT support (libxslt).
« More »

XSLTParam

Class that holds an XSLT parameter.

« More »

ReplaceTokens

Replaces tokens in the original input with user-supplied values.

Example: <pre><replacetokens begintoken="#" endtoken="#">; <token key="DATE" value="${TODAY}"/> </replacetokens></pre> Or: <pre><filterreader classname="phing.filters.ReplaceTokens"> <param type="tokenchar" name="begintoken" value="#"/> <param type="tokenchar" name="endtoken" value="#"/> <param type="token" name="DATE" value="${TODAY}"/> </filterreader></pre>
« More »

Token

Holds a token.

« More »

TidyFilter

This filter uses the bundled-with-PHP Tidy extension to filter input.

<p> Example:<br/> <pre> <tidyfilter encoding="utf8"> <config name="indent" value="true"/> <config name="output-xhtml" value="true"/> </tidyfilter> </pre>
« More »

StripWhitespace

Strips whitespace from [php] files using PHP stripwhitespace() method.

« More »

ReplaceRegexp

Performs a regexp find/replace on stream.

<p> Example:<br> <pre> <replaceregexp> <regexp pattern="\r\n" replace="\n"/> <regexp pattern="(\w+)\.xml" replace="\1.php" ignoreCase="true"/> </replaceregexp> </pre>
« More »