Task Elements

A task is a piece of PHP code that can be executed. This code implements a particular action to perform (i.e. install a file). Therefore it must be defined in the buildfile so that it is actually invoked by Phing.

These references will be resolved before the task is executed.

Tasks have a common structure:

<name attribute1="value1" attribute2="value2" ... />

where name is the name of the task, attributeN is the attribute name, and valueN is the value for this attribute.

There is a set of core tasks (see Core tasks) along with a number of optional tasks. It is also very easy to write your own tasks (see Extending Phing).

Tasks can be assigned an id attribute:

<taskname id="taskID" ... />

By doing this you can refer to specific tasks later on in the code of other tasks.