Re: include path sub dirs and php.ini
| From: | Matt McClanahan | Date: | Wed, 03 Jan 2001 19:46:12 +0000 |
| Subject: | Re: include path sub dirs and php.ini | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32538@lists.php.net to get a copy of this message | ||
On Wed, 3 Jan 2001, Lewis Bergman wrote:
> I apologize if this gis a second post but I goat an error back.
>
> I would like to include the entire PEAR tree in the php.ini include_path
> variable. I cannot seem to make this work however. PEAR is laid out like this:
> /usr/local/lib/php
> |
> |-DB---------
> |-HTTP |-mysql.php
> |-etc... |-pgsql.php
>
> and so on. I am trying to avoid putting all the PEAR directories into the
> include_path. IS there a way to include the top level dir and recurse down?
If you specify a relative path in your include/require calls, the
include_path will be searched for that relative path. So the only path
you need in your include_path to have Pear accessible is the parent
directory.
That is, if your include_path includes /usr/local/lib/php..
include 'DB/mysql.php';
will find /usr/local/lib/php/DB/mysql.php. This is highly prefereable to
including all Pear directories in the include_path.
Matt