| Using PEAR Packages in Applications |
| Article Index |
|---|
| Using PEAR Packages in Applications |
| Page 2 |
<filelist>
<file role="php" baseinstalldir="/" name="DB.php"/>
<file role="php" name="DB\common.php"/>
<file role="php" name="DB\dbase.php"/>
<file role="php" name="DB\fbsql.php"/>
<file role="php" name="DB\ibase.php"/>
<file role="php" name="DB\ifx.php"/>
<file role="php" name="DB\msql.php"/>
<file role="php" name="DB\mssql.php"/>
<file role="php" name="DB\mysql.php"/>
<file role="php" name="DB\mysqli.php"/>
<file role="php" name="DB\oci8.php"/>
<file role="php" name="DB\odbc.php"/>
<file role="php" name="DB\pgsql.php"/>
<file role="php" name="DB\sybase.php"/>
<file role="php" name="DB\storage.php"/>
<file role="php" name="DB\sqlite.php"/>
...
</filelist>
Notice that the role of these files is "php." These are the files that are important to install for the package. Other common roles include "doc" and "test," which can be excluded from the application, but can be helpful in learning how the package works. Following the structure given in <filelist> and given the lib/pear base location of all PEAR packages for this application, DB.php would go to lib/pear, whereas all the other files in the DB package would go to lib/pear/DB.
Finally, now that the files have a home and the dependencies have been satisfied, the best method for configuring the application to correctly use the PEAR packages is to modify the include_path from the application level. This will ensure that the code within the PEAR packages can find and include any files upon which it is dependent. To do this, place the following code at the top of all files that will use any of the PEAR packages, or place it in a global configuration file:
$include_path = ini_get('include_path') . PATH_SEPARATOR . '/path/to/lib/pear';
ini_set('include_path', $include_path);
This will add the application's lib/pear directory to the include_path so that the PEAR packages may be included as described in the section "."
TIPTo find out more about the package.xml file definition, visit . |
| Users' Comments (0) |
|
No comment posted









