CHAPTER 15 ■ AN INTRODUCTION TO PEAR AND PYRUS
Table 15–3. package.xml Dependency Types
Element Description
php The PHP application
package A PEAR package
extension A PHP extension (a capability compiled into PHP such as zlib or GD)
arch Operating system and processor architecture
os An operating system
Up until now I have specified mandatory dependencies. In fact, after requires, you can specify an
optional element. This accepts the same dependency elements. When PEAR encounters an unfilled
optional dependency, it will raise a warning but will continue to install nonetheless. You should add
depencies to the optional element where your package can limp along adequately without the preferred
package or extension.
If the user runs the pear install command with the -o flag
pear install -o package.xml
then PEAR will attempt to download and install all unmet required dependencies (remember, though
that passing -o to pyrus means that it will install optional requrements). Running the command with the
-a flag also automates the download of dependencies but will take in optional as well as required
packages.
Tweaking Installation with phprelease
Although you define the files in a package archive with the contents element, you can use phprelease to
fine tune the files that are actually installed onto the users system. Here are the two phprelease elements
in our package: