This appendix contains a reference of all optional tasks, i.e. tasks that are not directly needed for building projects, but can assist in various aspects of development and deployment.
This reference lists the tasks alphabetically by the name of the classes that
implement the tasks. So if you are searching for the reference to the <phplint>
tag, for example, you will want to look at the reference of PhpLintTask.
The DbDeployTask creates .sql files for making revisions to a database, based on dbdeploy conventions centering around a changelog table in the database. See rules for using dbdeploy for more information. You will need a changelog table like so:
CREATE TABLE changelog ( change_number BIGINT NOT NULL, delta_set VARCHAR(10) NOT NULL, start_dt TIMESTAMP NOT NULL, complete_dt TIMESTAMP NULL, applied_by VARCHAR(100) NOT NULL, description VARCHAR(500) NOT NULL )
<taskdef name="dbdeploy" classname="phing.tasks.ext.dbdeploy.DbDeployTask"/> <dbdeploy url="sqlite:${project.basedir}/data/db.sqlite"> userid="dbdeploy" password="dbdeploy" dir="${project.basedir}/data/dbdeploy/deltas" />
The above example uses a sqlite database and delta scripts located in dbdeploy/deltas in the project base dir.
Name | Type | Description | Default | Required |
---|---|---|---|---|
url | String | PDO connection url | n/a | Yes |
userid | String | DB userid to use for accessing the changelog table | none | As required by db |
password | String | DB password to use for accessing the changelog table | none | As required by db |
dir | String | Directory containing dbdeploy delta scripts | none | Yes |
outputfile | String | Filename in which deployment SQL will be generated | dbdeploy_deploy.sql | No |
undooutputfile | String | Filename in which undo SQL will be generated | dbdeploy_undo.sql | No |
deltaset | String | deltaset to check within db | Main | No |
lastchangetoapply | Integer | Highest-numbered delta script to apply to db | 999 | No |
The CoverageMergerTask merges code coverage information from external sources with an existing code coverage database.
The format of the code coverage files is expected to be identical to:
file_put_contents('/www/live/testcases/coverage.data', serialize(xdebug_get_code_coverage));
<coverage-merger> <fileset dir="/www/live/testcases"> <include name="**/*.data"/> </fileset> </coverage-merger>
The CoverageReportTask formats a coverage database into a framed HTML report using XSLT.
Name | Type | Description | Default | Required |
---|---|---|---|---|
outfile | String | The location for the intermediate XML file. | coverage.db | Yes |
Name | Type | Description | Default | Required |
---|---|---|---|---|
styledir | String | The directory where the stylesheets are located. | n/a | Yes |
todir | String | The directory where the files resulting from the transformation should be written to. | Yes |
<coverage-report outfile="reports/coverage.xml"> <report todir="reports/coverage" styledir="/home/phing/etc"/> </coverage-report>
The CoverageSetupTask prepares a database which can be used to gather code coverage information for unit tests. The code coverage tasks use the Xdebug extension.
Name | Type | Description | Default | Required |
---|---|---|---|---|
database | String | The location for the coverage database. | coverage.db | Yes |
<coverage-setup database="./reports/coverage.db"> <fileset dir="classes"> <include name="**/*.php"/> </fileset> </coverage-setup> <phpunit codecoverage="true"> <batchtest> <fileset dir="src"> <include name="*Test.php"/> </fileset> </batchtest> </phpunit>
The IoncubeEncoderTask executes the ionCube encoder (for either PHP4 or PHP5 projects).
For more information on the meaning of the various options please consult the ionCube user guide.
<ioncubeencoder binary="true" copy="*.ini config/*" encode="*.inc licenses/license.key" encrypt="*.tpl *.xml" encrypt="more" fromdir="files" ignore="*.bak RCS/ *~ docs/" ioncubepath="/usr/local/ioncube" keep="docs/README" licensepath="mylicense.txt" optimize="max" passphrase="mypassphrase" phpversion="4" targetoption="replace" todir="encoded" withoutruntimeloadersupport="true"> <comment>A project encoded with the ionCube encoder.</comment> </ioncubeencoder>
Name | Type | Description | Default | Required |
---|---|---|---|---|
allowedserver | String | Restricts the encoded files to particular servers and/or domains. Consult the IonCude documentation for more information. | none | No |
binary | Boolean | Whether to save encoded files in binary format (default is ASCII format) | false | No |
copy | String | Specifies files or directories to exclude from being encoded or encrypted and copy them to the target directory (separated by space). | none | No |
encode | String | Specifies additional file patterns, files or directories to encode, or to reverse the effect of copy | none | No |
encrypt | String | Specify files or directories (space separated list) that are to be encrypted. | none | No |
expirein | String | Sets a period in seconds (s), minutes (m), hours (h) or days (d) after which the files expire. Accepts: 500s or 55m or 24h or 7d | none | No |
expireon | String | Sets a YYYY-MM-DD date to expire the files. | none | No |
fromdir | String | Path containing source files | none | Yes |
ignore | String | Set files and directories to ignore entirely and exclude from the target directory (separated by space). | none | Yes |
ioncubepath | String | Path to the ionCube binaries | /usr/local/ioncube | No |
keep | String | Set files and directories not to be ignored (separated by space)./td> | none | No |
licensepath | String | Path to the license file that will be used by the encoded files | none | No |
nodoccomments | String | Omits documents comments ( /** ... */ ) from the encoded files. | none | No |
obfuscation-key | String | The obfuscation key must be supplied when using the obfuscate option | none | No |
obfuscate | String | The Encoder can obfuscate the names of global functions, the names of local variables in global functions, and line numbers. Use either all or any of functions, locals or linenos separated by a space. | none | No |
optimize | String | Controls the optimization of the encoded files, accepts either more or max | none | No |
passphrase | String | The passphrase to use when encoding with a license file | none | No |
phpversion | Integer | The PHP version to use | 5 | No |
targetoption | String | Option to use when target directory exists, accepts replace, merge, update and rename | none | No |
todir | String | Path to save encoded files to | none | Yes |
withoutruntimeloadersupport | Boolean | Wether to disable support for runtime initialization of the ionCube Loader | false | No |
Custom text that is added to the start of each encoded file.
The IoncubeLicenseTask executes the ionCube make_license program.
For more information on the meaning of the various options please consult the ionCube user guide.
<ioncubelicense ioncubepath="/usr/local/ioncube" licensepath="mylicense.txt" passphrase="mypassphrase"> <comment>A license file made with the ionCube encoder.</comment> </ioncubelicense>
Name | Type | Description | Default | Required |
---|---|---|---|---|
ioncubepath | String | Path to the ionCube binaries | /usr/local/ioncube | No |
licensepath | String | Path to the license file that will be generated | none | No |
passphrase | String | The passphrase to use when generating the license file | none | No |
Custom text that is added to the start of each encoded file.
The PDOSQLExecTask executes SQL statements using PDO.
<pdo url="pgsql:host=localhost dbname=test"> <fileset dir="sqlfiles"> <include name="*.sql"/> </fileset>
</pdo>
<pdo url="mysql:host=localhost;dbname=test" userid="username" password="password"> <transaction src="path/to/sqlfile.sql"/> <formatter type="plain" outfile="path/to/output.txt"/> </pdo>
Name | Type | Description | Default | Required |
---|---|---|---|---|
url | String | PDO connection URL (DSN) | none | Yes |
userid | String | Username for connection (if it cannot be specified in URL) | none | No |
password | String | The password to use for the connection (if it cannot be specified in URL) | none | No |
encoding | String | The database encoding. | none | No |
src | File | A single source file of SQL statements to execute. | none | No |
onerror | String | The action to perform on error (continue, stop, or abort) | abort | No |
delimiter | String | The delimeter to separate SQL statements (e.g. "GO" in MSSQL) | ; | No |
delimitertype | String | The delimiter type ("normal" or "row"). Normal means that any occurence of the delimiter terminate the SQL command whereas with row, only a line containing just the delimiter is recognized as the end of the command. | normal | No |
Wrapper for a single transaction.
Files containing SQL statements.
The results of any queries that are executed can be printed in different formats. Output will always be sent to a file, unless you set the usefile attribute to false. The path to the output file file can be specified by the outfile attribute; there is a default filename that will be returned by the formatter if no output file is specified.
There are three predefined formatters - one prints the query results in XML format, the other emits plain text. Custom formatters that extend phing.tasks.pdo.PDOResultFormatter can be specified.
Name | Type | Description | Default | Required |
---|---|---|---|---|
type | String | Use a predefined formatter (either xml or plain). | n/a | One of these attributes is required. |
classname | String | Name of a custom formatter class (must extend phing.tasks.ext.pdo.PDOResultFormatter). | n/a | |
usefile | Boolean | Boolean that determines whether output should be sent to a file. | true | No |
outfile | File | Path to file in which to store result. | Depends on formatter | No |
showheaders | Boolean | (only applies to plain formatter) Whether to show column headers. | false | No |
coldelim | String | (only applies to plain formatter) The column delimiter. | , | No |
rowdelim | String | (only applies to plain formatter) The row delimiter. | \n | No |
encoding | String | (only applies to XML formatter) The xml document encoding. | (PHP default) | No |
formatoutput | Boolean | (only applies to XML formatter) Whether to format XML output. | true | No |
<pdo url="pgsql:host=localhost dbname=test"> <fileset dir="sqlfiles"> <include name="*.sql"/> </fileset> <!-- xml formatter --> <formatter type="xml" output="output.xml"/> <!-- custom formatter --> <formatter classname="path.to.CustomFormatterClass"> <param name="someClassAttrib" value="some-value"/> </formatter> <!-- No output file + usefile=false means it goes to phing log --> <formatter type="plain" usefile="false" />
</pdo>
With the PearPackageTask, you can create a package.xml which can be installed using the PEAR installer. Use this in conjunction with the TarTask to completely script the building of a PEAR pacakge.
Note that this task creates a version 1 package.xml file.
This task uses the PEAR_PackageFileManager class. In order to be maximally flexible, the majority of options are set generically (using <option> tag) and are set using PEAR_PackageFileManager::setOptions(). Use the <mapping> tag to represent complex values (which are turned into associative arrays and also set using setOptions() method).
<pearpkg name="phing" dir="${build.src.dir}" destFile="${build.base.dir}/package.xml"> <fileset> <include name="**"/> </fileset> <option name="notes">Sample release notes here.</option> <option name="description">Package description</option> <option name="summary">Short description</option> <option name="version" value="2.0.0b1"/> <option name="state" value="beta"/> <mapping name="maintainers"> <element> <element key="handle" value="hlellelid"/> <element key="name" value="Hans"/> <element key="email" value="hans@xmpl.org"/> <element key="role" value="lead"/> </element> </mapping> </pearpkg>
Name | Type | Description | Default | Required |
---|---|---|---|---|
name | String | The name of the PEAR package. | n/a | Yes |
dir | String | The base directory of files to add to package. | n/a | Yes |
destFile | String | The file to create. | package.xml in base directory | No |
With the PearPackage2Task, you can create a version 2 package.xml which can be installed using the PEAR installer. Use this in conjunction with the TarTask to completely script the building of a PEAR pacakge.
This task uses the PEAR_PackageFileManager2 class. In order to be maximally flexible, the majority of options are set generically (using <option> tag) and are set using PEAR_PackageFileManager::setOptions(). Use the <mapping> tag to represent complex values.
Note that Travis Swicegood has created a more complete implementation of this functionality which can be found here: http://pear.domain51.com/index.php?package=Phing_d51PearPkg2Task.
<pearpkg2 name="phing" dir="${build.src.dir}"> <option name="outputdirectory" value="./build"/>
<option name="packagefile" value="package2.xml"/>
<option name="packagedirectory" value="./${build.dist.dir}"/>
<option name="baseinstalldir" value="${pkg.prefix}"/>
<option name="channel" value="my.pear-channel.com"/>
<option name="summary" value="${pkg.summary}"/>
<option name="description" value="${pkg.description}"/>
<option name="apiversion" value="${pkg.version}"/>
<option name="apistability" value="beta"/>
<option name="releaseversion" value="${pkg.version}"/>
<option name="releasestability" value="beta"/>
<option name="license" value="none"/>
<option name="phpdep" value="5.0.0"/>
<option name="pearinstallerdep" value="1.4.6"/>
<option name="packagetype" value="php"/>
<option name="notes" value="${pkg.relnotes}"/>
<mapping name="maintainers">
<element>
<element key="handle" value="hlellelid"/>
<element key="name" value="Hans"/>
<element key="email" value="hans@xmpl.org"/>
<element key="role" value="lead"/>
</element>
</mapping>
</pearpkg2>
Name | Type | Description | Default | Required |
---|---|---|---|---|
name | String | The name of the PEAR package. | n/a | Yes |
dir | String | The base directory of files to add to package. | n/a | Yes |
This task runs PHP_CodeSniffer to detect violations of a defined set of coding standards.
Name | Type | Description | Default | Required |
---|---|---|---|---|
standard | String | The name of the standard or an absolute path to an external standard to check for. | Generic | No |
outputFormat | String | The output format. The default format is specified in the task itself. Additionally the formats of CodeSniffer can be choosen: xml, checkstyle, csv, report and summary. A special case is the format doc which generates the documentation of the standard. | default | No |
showSniffs | Boolean | Print the list of used sniffs. | false | No |
showWarnings | Boolean | Print warnings. | true | No |
file | String | The file or folder to check (usally the nested tag fileset is used instead). | false | Either this attribute or the nested tag fileset is required. |
sniffs | String | The list of allowed sniffs (separated by space, comma or semicolon). The sniffs must be part of the choosen standard. | n/a | No |
verbosity | Integer | The verbosity level of CodeSniffer where level 1 prints progress information and level 2 prints developer debug information. | 0 | No |
tabWidth | Integer | Replaces tabs with the given number of spaces. If zero no replacing is done. | 0 | No |
allowedFileExtensions | String | The allowed file extensions (separated by space, comma or semicolon) when a directory is specified in the file attribute. | php | No |
ignorePatterns | String | The patterns to ignore files and folders (separated by space, comma or semicolon) when a directory is specified in the file attribute. | n/a | No |
noSubdirectories | Boolean | Do not recurse into subdirectories when a directory is specified in the file attribute. | false | No |
Either this nested tag or the attribute file is required.
The configuration parameters which are usally loaded from the CodeSniffer.conf can be set.
Name | Type | Description | Default | Required |
---|---|---|---|---|
name | String | Name of the configuration parameter. | n/a | Yes |
value | String | Value of the configuration parameter. | n/a | Yes |
Checks all files in the directory file matching the allowed file extension with the PEAR standard and prints the summary report without warnings.
<phpcodesniffer standard="PEAR" format="summary" file="/path/to/source-files" allowedFileExtensions="php php5 inc"/> </phpcodesniffer>
Checks all matching files in the directory dir with a custom external standard, sets the zend_ca_path configuration which may be required by one of the sniffs, prints a list of used sniffs and prints the default report with warnings.
<phpunit standard="/path/to/external-standard" showSniffs="true" showWarnigns="true"> <fileset dir="/path/to/source-files"> <include name="**/*.php"/> </fileset> <config name="zend_ca_path" value="/path/to/ZendStudio/bin/ZendCodeAnalyzer"> </phpunit>
Externally stored custom standard have to follow the same naming conventions as if they were stored in the Standards subdirectory of PHP_CodeSniffer itself.
This task runs phpDocumentor, an auto-documentation tool for PHP similar to Javadoc.
Name | Type | Description | Default | Required |
---|---|---|---|---|
title | String | Title for browser window / package index. | n/a | No |
destdir | String | Destination directory for output files. | n/a | Yes |
target | String | Alias of destdir ("target" is config param used by PhpDocumentor) | n/a | |
output | String | Output format (such as HTML:Smarty:PHP). | n/a | Yes |
sourcecode | Boolean | Generate syntax-highlighted sourcecode file for each file parsed? | false | No |
examplesdir | String | Path to directory in which to look for example documentation. | n/a | No |
parseprivate | Boolean | Parse @internal and elements marked private. | false | No |
javadocdesc | Boolean | JavaDoc-compliant description parsing. Use on/off, default off (more flexibility) | false | No |
quiet | Boolean | Suppress output to STDOUT. | false | No |
packageoutput | String | Output documentation only for selected packages. Use a comma-delimited list | n/a | No |
ignoretags | String | Comma-separated list of tags to ignore (@package, @subpackage, @access and @ignore may not be ignored). | n/a | No |
defaultpackagename | String | name to use for the default package. If not specified, uses 'default' | n/a | No |
defaultcategoryname | String | name to use for the default category. If not specified, uses 'default' | n/a | No |
pear | Boolean | Treat parse dirs as PEAR repository? (package is directory, _members are @access private) | false | No |
templatebase | String | Set base dirctory of all templates for this parse. | n/a | No |
undocumentedelements | Boolean | Control whether or not warnings will be shown for undocumented elements. Useful for identifying classes and methods that haven't yet been documented. | false | No |
customtags | Boolean | Custom tags, will be recognized and put in tags[] instead of unknowntags[]. | false | No |
<phpdoc title="API Documentation" destdir="apidocs" sourcecode="no" output="HTML:Smarty:PHP"> <fileset dir="./classes"> <include name="**/*.php" /> </fileset> <projdocfileset dir="."> <include name="README" /> <include name="INSTALL" /> <include name="CHANGELOG" /> </projdocfileset> </phpdoc>
This is the same as the PhpDocumentorTask but uses the command line application. Use this as a fallback in case you're running into troubles when using the phpDocumentor-library with the PhpDocumentorTask directly, e.g. when you're using Smarty and have Smarty in your library path too.
This task supports everything the PhpDocumentorTask supports, differences are documented below.
Name | Type | Description | Default | Required |
---|---|---|---|---|
programpath | String | Path to the phpdoc executable (relative or absolute). | n/a | No |
sourcepath | String | A directory to scan for parsable files. Supports multiple directories separated with a comma. | n/a | Yes, if no <fileset> is given |
Name | Description |
---|---|
configdir | Currently not supported. The attribute will be ignored and a warning messag will be generated. The build continues (to ease when changing an existing phpdoc task) however this may have unexpected side effects. |
The PhpLintTask checks syntax (lint) on one or more PHP source code files.
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | Path to source file | n/a | No |
haltonfailure | Boolean | Stop the build process if the linting process. | false | No |
errorproperty | String | The name of a property that will be set to contain the error string (if any). | n/a | No |
interpreter | string | Path to alternative PHP interpreter | Defaults to the ${php.command} property which is the interpreter used to execute phing itself. | No |
<phplint file="path/to/source.php"/>
Checking syntax of one particular source file.
<phplint> <fileset dir="src"> <include name="**/*.php"/> </fileset> </phplint>
Check syntax of a fileset of source files.
This task runs testcases using the PHPUnit framework. It is a functional port of the Ant JUnit task.
NB: the identifiers phpunit2 (PHPUnit2Task) and phpunit3 (PHPUnit3Task) have been deprecated, but are still available to maintain backwards compatibility.
Name | Type | Description | Default | Required |
---|---|---|---|---|
printsummary | Boolean | Print one-line statistics for each testcase. | false | No |
codecoverage | Boolean | Gather code coverage information while running tests (requires Xdebug). | false | No |
haltonerror | Boolean | Stop the build process if an error occurs during the test run. | false | No |
haltonfailure | Boolean | Stop the build process if a test fails (errors are considered failures as well). | false | No |
haltonincomplete | Boolean | Stop the build process if any incomplete tests are encountered. | false | No |
haltonskipped | Boolean | Stop the build process if any skipped tests are encountered. | false | No |
failureproperty | String | Name of property to set (to true) on failure. | n/a | No |
errorproperty | String | Name of property to set (to true) on error. | n/a | No |
incompleteproperty | String | Name of property to set (to true) on incomplete tests. | n/a | No |
skippedproperty | String | Name of property to set (to true) on skipped tests. | n/a | No |
The results of the tests can be printed in different formats. Output will always be sent to a file, unless you set the usefile attribute to false. The name of the file is predetermined by the formatter and can be changed by the outfile attribute.
There are three predefined formatters - one prints the test results in XML format, the other emits plain text. The formatter named brief will only print detailed information for testcases that failed, while plain gives a little statistics line for all test cases. Custom formatters that implement phing.tasks.ext.PHPUnitResultFormatter can be specified.
If you use the XML formatter, it may not include the same output that your tests have written as some characters are illegal in XML documents and will be dropped.
Name | Type | Description | Default | Required |
---|---|---|---|---|
type | String | Use a predefined formatter (either xml, plain, or brief). | n/a | One of these is required. |
classname | String | Name of a custom formatter class. | n/a | |
usefile | Boolean | Boolean that determines whether output should be sent to a file. | true | No |
todir | String | Directory to write the file to. | n/a | No |
outfile | String | Filename of the result. | Depends on formatter | No |
Define a number of tests based on pattern matching. batchtest collects the included files from any number of nested <fileset>s. It then generates a lists of classes that are (in)directly defined by each PHP file.
Name | Type | Description | Default | Required |
---|---|---|---|---|
exclude | String | A list of classes to exclude from the pattern matching. For example, when you have two baseclasses BaseWebTest and BaseMathTest, which are included a number of testcases (and thus added to the list of testclasses), you can exclude those classes from the list by typing exclude="BaseWebTest BaseMathTest". | n/a | No |
classpath | String | Used to define more paths on which - besides the PHP include_path - to look for the test files. | n/a | No |
<phpunit> <formatter todir="reports" type="xml"/> <batchtest> <fileset dir="tests"> <include name="**/*Test*.php"/> <exclude name="**/Abstract*.php"/> </fileset> </batchtest> </phpunit>
Runs all matching testcases in the directory tests, writing XML results to the directory reports.
<phpunit codecoverage="true" haltonfailure="true" haltonerror="true"> <formatter type="plain" usefile="false"/> <batchtest> <fileset dir="tests"> <include name="**/*Test*.php"/> </fileset> </batchtest> </phpunit>
Runs all matching testcases in the directory tests, gathers code coverage information, writing plain text results to the console. The build process is aborted if a test fails.
Important note: using a mechanism such as an "AllTests.php" file to execute testcases will bypass the Phing hooks used for reporting and counting, and could possibly lead to strange results. Instead, use one of more fileset's to provide a list of testcases to execute.
This task transforms PHPUnit xml reports to HTML using XSLT.
NB: the identifiers phpunit2report (PHPUnit2Report) and phpunit3report (PHPUnit3Report) have been deprecated, but are still available to maintain backwards compatibility.
Name | Type | Description | Default | Required |
---|---|---|---|---|
infile | String | The filename of the XML results file to use. | testsuites.xml | No |
format | String | The format of the generated report. Must be noframes or frames. | noframes | No |
styledir | String | The directory where the stylesheets are located. They must
conform to the following conventions:
|
n/a | Yes |
todir | String | The directory where the files resulting from the transformation should be written to. | Yes |
<phpunitreport infile="reports/testsuites.xml" format="frames" todir="reports/tests" styledir="/home/phing/etc"/>
Generates a framed report in the directory reports/tests using the file reports/testsuites.xml as input.
Important note: testclasses that are not explicitly placed in a package (by using a '@package' tag in the class-level DocBlock) are listed under the "default" package.
The SvnCheckoutTask checks out a Subversion repository to a local directory.
<svncheckout svnpath="/usr/bin/svn" username="anony" password="anony" nocache="true" repositoryurl="svn://localhost/project/trunk/" todir="/home/user/svnwc"/>
<svncheckout svnpath="C:/Subversion/bin/svn.exe" repositoryurl="svn://localhost/project/trunk/" todir="C:/projects/svnwc"/>
Name | Type | Description | Default | Required |
---|---|---|---|---|
svnpath | String | Path to Subversion binary | /usr/bin/svn | No |
repositoryurl | String | URL of SVN repository | none | Yes |
username | String | A username used to connect to the SVN server | none | No |
password | String | A password used to connect to the SVN server | none | No |
nocache | String | Connection credentials will not be cached | boolean | No |
todir | String | Path to export to | none | Yes |
recursive | Boolean | Recursive behavior | true | No |
ignoreexternals | Boolean | Ignore externals definitions | false | No |
The SvnExportTask exports a Subversion repository to a local directory.
<svnexport svnpath="/usr/bin/svn" username="anony" password="anony" force="true" nocache="true" repositoryurl="svn://localhost/project/trunk/" todir="/home/user/svnwc"/>
<svnexport svnpath="C:/Subversion/bin/svn.exe" repositoryurl="svn://localhost/project/trunk/" todir="C:/projects/svnwc"/>
Name | Type | Description | Default | Required |
---|---|---|---|---|
svnpath | String | Path to Subversion binary | /usr/bin/svn | No |
repositoryurl | String | URL of SVN repository | none | Yes |
username | String | A username used to connect to the SVN server | none | No |
password | String | A password used to connect to the SVN server | none | No |
force | String | Force overwrite files if they already exist | boolean | No |
nocache | String | Connection credentials will not be cached | boolean | No |
todir | String | Path to export to | none | Yes |
recursive | Boolean | Recursive behavior | true | No |
ignoreexternals | Boolean | Ignore externals definitions | false | No |
The SvnLastRevisionTask stores the number of the last revision of a Subversion workingcopy in a property.
<svnlastrevision svnpath="/usr/bin/svn" workingcopy="/home/user/svnwc" propertyname="svn.lastrevision"/>
<svnlastrevision svnpath="C:/Subversion/bin/svn.exe" workingcopy="C:/projects/svnwc" propertyname="svn.lastrevision"/>
Name | Type | Description | Default | Required |
---|---|---|---|---|
svnpath | String | Path to Subversion binary | /usr/bin/svn | No |
workingcopy | String | Working copy directory | none | Yes |
propertyname | String | Name of property to use | svn.lastrevision | No |
The SvnCheckoutTask updates a local directory.
<svnupdate svnpath="/usr/bin/svn" username="anony" password="anony" nocache="true" todir="/home/user/svnwc"/>
<svnupdate svnpath="C:/Subversion/bin/svn.exe" todir="C:/projects/svnwc"/>
Name | Type | Description | Default | Required |
---|---|---|---|---|
svnpath | String | Path to Subversion binary | /usr/bin/svn | No |
username | String | A username used to connect to the SVN server | none | No |
password | String | A password used to connect to the SVN server | none | No |
nocache | Boolean | Connection credentials will not be cached | false | No |
todir | String | Path to export to | none | Yes |
recursive | Boolean | Recursive behavior | true | No |
ignoreexternals | Boolean | Ignore externals definitions | false | No |
The TarTask creates a tarball from a fileset or directory.
<tar destfile="phing.tar" compression="gzip"> <fileset dir="."> <include name="**/**" /> </fileset> </tar>
The above example uses a fileset to determine which files to include in the archive.
<tar destfile="phing.tar" basedir="." compression="gzip"/>
The second example uses the basedir attribute to include the contents of that directory (including subdirectories) in the archive.
Name | Type | Description | Default | Required |
---|---|---|---|---|
destfile | String | Tarball filename | n/a | Yes |
basedir | String | Base directory to tar (if no fileset specified, entire directory contents will be included in tar) | none | No |
compression | String | Type of compression to use (gzip, bzip2, none) | none | No |
Important note #1: files are not replaced if they are already present in the archive.
Important note #2: using basedir and fileset simultaneously can result in strange contents in the archive.
The UntarTask unpacks one or more tar archives.
<untar file="testtar.tar.gz" todir="dest"> <fileset dir="."> <include name="*.tar.gz"/> <include name="*.tar"/> </fileset> </untar>
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | Archive filename | n/a | No |
todir | String | Directory to unpack the archive(s) to | none | Yes |
The UnzipTask unpacks one or more ZIP archives.
<unzip file="testzip.zip" todir="dest"> <fileset dir="."> <include name="*.zip"/> </fileset> </unzip>
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | Archive filename | n/a | No |
todir | String | Directory to unpack the archive(s) to | none | Yes |
The XmlLintTask checks syntax (lint) one or more XML files against an XML Schema Definition.
Name | Type | Description | Default | Required |
---|---|---|---|---|
schema | String | Path to XSD file | n/a | Yes |
file | String | Path to XML file | n/a | No |
<xmllint schema="schema.xsd" file="config.xml"/>
Validate one XML file against one XSD file.
<xmllint schema="schema.xsd"> <fileset dir="."> <include name="**/config.xml"/> </fileset> </xmllint>
Validate more XML files against one XSD file.
The ZendCodeAnalyzerTask analyze PHP source files using the Zend Code Analyzer tool that ships with all versions of Zend Studio.
Name | Type | Description | Default | Required |
---|---|---|---|---|
analyzerPath | String | Path to Zend Code Analyzer binary | n/a | Yes |
file | String | Path to PHP source file | n/a | No |
disable | String | Disable warnings seperated by comma | n/a | No |
enable | String | Enable warnings separated by comma | n/a | No |
<analyze analyzerPath="/usr/local/Zend/ZendStudioClient-5.1.0/bin/ZendCodeAnalyzer" file="SomeClass.php"/>
Analyze one PHP source file with all default warnings enabled.
<analyze analyzerPath="/usr/local/Zend/ZendStudioClient-5.1.0/bin/ZendCodeAnalyzer" disable="var-ref-notmodified,if-if-else"> <fileset dir="."> <include name="**/*.php"/> </fileset> </analyze>
Analyze a set of PHP source files and disable a few warnings.
The ZipTask creates a .zip archive from a fileset or directory.
<zip destfile="phing.zip"> <fileset dir="."> <include name="**/**" /> </fileset> </zip>
The above example uses a fileset to determine which files to include in the archive.
<zip destfile="phing.zip" basedir="."/>
The second example uses the basedir attribute to include the contents of that directory (including subdirectories) in the archive.
Name | Type | Description | Default | Required |
---|---|---|---|---|
destfile | String | .ZIP filename | n/a | Yes |
basedir | String | Base directory to zip (if no fileset specified, entire directory contents will be included in the archive) | none | No |
Important note: using basedir and fileset simultaneously can result in strange contents in the archive.