Main Menu
Forums
Programming
Contest
Documentation
Partner
Sites
Sponsors
The package definition file package.xml
The package definition file package.xml is,
as the name already implies, a well-formed XML file that contains
all information about a PEAR package.
This chapter will describe the allowed elements of the package
definition file and it will discuss how to create such a file for
your package.
The PEAR_PackageFileManager
package simplifies the creation of package.xml.
You can install PEAR_PackageFileManager via the usual command
$ pear install PEAR_PackageFileManager
The role -attribute in the <file> tag
defines what type the file has and in which location it should
be installed.
Table 15-1. Possible values
Value Destination dir php PHP source file the directory is determined by the package name ext Extension, dynamically loadable library the PHP extension directory or
PHP_PEAR_EXTENSION_DIR
if defined doc Documentation file {PEAR_documentation_dir}/Package_Name/ data Package related data files (graphics, data tables etc) {PEAR_data_dir}/Package_Name/ test Package related test files (unit-tests etc) {PEAR_test_dir}/Package_Name/ script Package related shell scripts the PHP binary directory or
PHP_PEAR_BIN_DIR
if defined src and extsrc C or C++ source code not copied directly - used to build a
extension
The PEAR Package Manager supports checking for
different system capabilities. You define those
dependencies with the <dep> tag:
The rel -attribute
defines the relationship between the existing
capability and the required.
Table 15-3. rel values
Value Meaning Can be used with has has
the existing capability must have the
requirement - version-attribute is
ignored
pkg, ext, php, prog, os, sapi, zend eq equal
the the existing capability must exactly match the
version value
pkg, ext, php, prog, os, sapi, zend lt less than
the existing capability must be less than the version value
pkg, ext, php, zend le less than or equal
the existing capability must be less than or equal to the
version value
pkg, ext, php, zend gt greater than
the existing capability must be greater than the version
value
pkg, ext, php, zend ge greater than or equal
the existing capability must greater than or equal to the
version value
pkg, ext, php, zend not conflicting dependency
the dependency conflicts with the package, the two cannot co-exist.
version is ignored.
ext, php
Has will be used if no other value has been
defined. Note that rel is required in PEAR 1.4.0 and newer.