This appendix contains a reference of the system data types contained in Phing.
FileLists offer a way to represent a specific list of files. Unlike FileSets, FileLists may contain files that do not exist on the filesystem. Also, FileLists can represent files in a specific order -- whereas FileSets represent files in whichever order they are returned by the filesystem.
<filelist dir="/etc" files="httpd/conf/httpd.conf,php.ini"/>
Or you can use a listfile, which is expected to contain one filename per line:
<filelist dir="conf/" listfile="ini_files.txt"/>
This will grab each file as listed in ini_files.txt. This can be useful if one task compiles a list of files to process and another task needs to read in that list and perform some action to those files.
Name | Type | Description | Default | Required |
---|---|---|---|---|
dir | String | The directory, to which the paths given in files or listfile are relative. | n/a | Yes |
files | String | Comma or space-separated list of files. | n/a | Yes (or listfile) |
listfile | String | A text file with one filename per line. | n/a | Yes (or files) |
Filesets offer a easy and straigtforward way to include files. You can include/exclude files in/from a fileset using the <include>/<exclude> tags. In patterns, one asterisk (*) maps to a part of a file/directory name within a directory level. Two asterisks (**) may include above the "border" of the directory separator.
<fileset dir="/etc" > <include name="httpd/**" /> <include name="php.ini" /> </fileset>
This will include the apache configuration and PHP configuration file from /etc.
Name | Type | Description | Default | Required |
---|---|---|---|---|
dir | String | The directory, the paths given in include/exclude are relative to. | n/a | Yes |
The only tags that are supported by Fileset are the <include> and the <exclude> tags. These tags must have a name attribute that contains the pattern to include/exclude.
The Path data type can be used to respresent path structures. In many cases the path type will be used for nested <classpath> tags. E.g.
<path id="project.class.path"> <pathelement dir="lib/"/> <pathelement dir="ext/"/> </path> <target name="blah"> <taskdef name="mytask" path="myapp.phing.tasks.MyTask"> <classpath refid="project.class.path"/> </taskdef>
</target>
Name | Type | Description | Default | Required |
---|---|---|---|---|
dir | String | Specific path to directory | n/a | No |
path | String | A path (which contains multiple locations separated by path.separator) to add. | n/a | No |
The <path> tag supports nested <fileset> and <dirset> tags.