documenting a file in the tag (original) (raw)
– documenting a file in the tag
Describing files
The <file>
tag describes a file in a directory in the package sources. File tags may only occur as children of<[dir](guide.developers.package2.dir.php)>
tags.
File Tasks can be used to modify files at package time or at installation.
Attributes
Required attributes
Attribute name | Description |
---|---|
name | Name of the file in the sources |
role | Type of the file. See roles. |
Optional attributes
Attribute name | Description |
---|---|
baseinstalldir | Relative location where all files and subdirectories will be installed |
md5sum | MD5 hash about file contents.This is automatically generated when executing pear package, so you should never set it manually. |
Previous optional attributes (
package.xml
v1)<platform>
and<install-as>
have been replaced by therelease tags.Specifically,
<install>
is used to specify<install-as>
, and the<ignore>
tag can be used in conjunction with<installconditions>
to exclude packages from being installed on particular platforms.
Roles
The <role>
attribute in the<file>
tag defines what type the file has and in which location it should be installed.
Possible values
Role value | Description | Destination dir |
---|---|---|
php | PHP source file | $php_dir (your include path) |
doc | Documentation or example file | $doc_dir/Package_Name/ |
data | Package related data files (graphics, data tables, CSS etc.) | $data_dir/Package_Name/ |
www | Files for the HTTPd document root | $www_dir/ |
test | Package related test files (unit-tests etc) | $test_dir/Package_Name/ |
script | Package related shell scripts | the PHP binary directory ($bin_dir) orPHP_PEAR_BIN_DIR if defined |
ext | Extension, dynamically loadable library | the PHP extension directory ($ext_dir) or PHP_PEAR_EXTENSION_DIR if defined |
src / extsrc | C or C++ source code | not copied directly - used to build a extension |
Directory locations like $php_dir
are configurable in PEAR. You can usepear config-show orpear config-get php_dir to retrieve their values.