Online
 
Friday, 09 January 2009
 
 
More article:
Related Content:

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 "."

TIP

To find out more about the package.xml file definition, visit .



Tags: Add more tags...,
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment. Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Your Ad Here
Natural 124
Statistic


Last Post

 
Top! Top!