The <file> tag describes a file in a
directory in the package sources.
File tags may only occur as children of
<dir>
tags.
File Tasks can be used to modify files at package time or at installation.
| Attribute name | Description |
|---|---|
| name | Name of the file in the sources |
| role | Type of the file. See roles. |
| 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. |
Note: Previous optional attributes (package.xml v1)platformandinstall-ashave been replaced by the release tags.
Specifically,<install>is used to specifyinstall-as, and the<ignore>tag can be used in conjunction with<installconditions>to exclude packages from being installed on particular platforms.
The role attribute in the
<file> tag defines what type the file has and in
which location it should be installed.
| 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) or PHP_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 use pear config-show or pear config-get php_dir to retrieve their values.