PEAR - Includes
Posted: Tue Mar 22, 2005 7:49 pm
I've been looking at what Pear is about, and it sounds really, really cool. However, my webhost told me that they only have these packages installed:
Which is only a smattering of what PEAR has to offer (I'm particularly interested in the BBCode Parser). However, I'm baffled as to how to include these files in my scripts.
According to what I gather so far, doing this:
Will load the DB class. More delving revealed that this INI setting:
Is responsible for telling where to have the script look for an include file if the include fails for the directory.
I am now confused. Utterly confused.
Say I have a PEAR package named DB.php. I also, coincidentally, have a file in my working directory called DB.php
What do I do? If I want to call the PEAR package? If I want to call the DB.php from me?
And then, since I don't have root access to the server, I'll have to install the package in some top level directory seperate from the Include specified in the ini directory.
How do I include the files then (do I have to manually tell the script to go to that path, or can I like, change the ini setting? And if I change the ini setting, does that mean that I have to switch it back If I call a preinstalled package? Or should I just not bother using the already included packages and put everything in one place to stop myself from confusing myself?)
Code: Select all
Installed packages:
===================
Package Version State
Archive_Tar 1.1 stable
Console_Getopt 1.2 stable
DB 1.6.2 stable
HTTP 1.2.2 stable
Mail 1.1.3 stable
Net_SMTP 1.2.6 stable
Net_Socket 1.0.1 stable
PEAR 1.3.2 stable
XML_Parser 1.0.1 stable
XML_RPC 1.1.0 stableAccording to what I gather so far, doing this:
Code: Select all
require "DB.php";Code: Select all
ini_set("include_path", '/var/www/www.example.com/includes/' .PATH_SEPARATOR . ini_get("include_path"));I am now confused. Utterly confused.
Say I have a PEAR package named DB.php. I also, coincidentally, have a file in my working directory called DB.php
What do I do? If I want to call the PEAR package? If I want to call the DB.php from me?
And then, since I don't have root access to the server, I'll have to install the package in some top level directory seperate from the Include specified in the ini directory.
How do I include the files then (do I have to manually tell the script to go to that path, or can I like, change the ini setting? And if I change the ini setting, does that mean that I have to switch it back If I call a preinstalled package? Or should I just not bother using the already included packages and put everything in one place to stop myself from confusing myself?)