Classes, interfaces and traits
ChainableReader¶
Interface indicating that a reader may be chained to another one.
« More »
BaseFilterReader¶
Base class for core filter readers.
« More »
BaseParamFilterReader¶
Base class for core filter readers.
« More »
ConcatFilter¶
Concats a file before and/or after the file.
Example:
```
<copy todir="build">
<fileset dir="src" includes="*.php"/>
<filterchain>
<concatfilter prepend="license.txt"/>
</filterchain>
</copy>
```
Copies all php sources from `src` to `build` and adds the
content of `license.txt` add the beginning of each
file.
« More »
EscapeUnicode¶
UTF-8 to Unicode Code Points
This method converts non-latin characters to unicode escapes.
Useful to load properties containing non latin.
Example:
`<escapeunicode>`
Or:
`<filterreader classname="phing.filters.EscapeUnicode"/>`
« 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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
SortFilter¶
<p>
Sort a file before and/or after the file.
</p>
<p>
Examples:
</p>
<pre>
<copy todir="build">
<fileset dir="input" includes="*.txt"/>
<filterchain>
<sortfilter/>
</filterchain>
</copy>
</pre>
<p>
Sort all files <code>*.txt</code> from <i>src</i> location and copy
them into <i>build</i> location. The lines of each file are sorted
in ascendant order comparing the lines.
</p>
<pre>
<copy todir="build">
<fileset dir="input" includes="*.txt"/>
<filterchain>
<sortfilter reverse="true"/>
</filterchain>
</copy>
</pre>
<p>
Sort all files <code>*.txt</code> from <i>src</i> location into reverse
order and copy them into <i>build</i> location. If reverse parameter has
value <code>true</code> (default value), then the output line of the files
will be in ascendant order.
</p>
« More »
StripLineBreaks¶
Filter to flatten the stream to a single line.
Example:
<pre><striplinebreaks/></pre>
Or:
<pre><filterreader classname="phing.filters.StripLineBreaks"/></pre>
« More »
StripWhitespace¶
Strips whitespace from [php] files using PHP stripwhitespace() method.
« More »
SuffixLines¶
Attaches a suffix to every line.
Example:
<pre><suffixlines suffix="Foo"/></pre>
Or:
<pre><filterreader classname="phing.filters.SuffixLines">
<param name="suffix" value="Foo"/>
</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 »
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 »
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 »
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 »
XincludeFilter¶
Applies Xinclude parsing to incoming text.
Uses PHP DOM XML support
« More »
XsltFilter¶
Applies XSL stylesheet to incoming text.
Uses PHP XSLT support (libxslt).
« More »
XSLTParam¶
Class that holds an XSLT parameter.
« More »