Re: Pear Auth, a couple of questions

From: Date: Sat, 15 May 2004 12:37:41 +0000
Subject: Re: Pear Auth, a couple of questions
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12501@lists.php.net to get a copy of this message
Hello Brandon,
1. Is there any way to make Auth use an already existing db connection to do whatever it needs to do? On my page I already have a db connection open, but when I create the auth object, won't that create a new connection? that is not what i want; but I would like for it to use the already existing one. is there a way to do so?
I'm not an Auth expert, however, according to the comments in the Auth DB Container source the value that you pass as $options can be either "Connection data or DB object". Try passing your DB object instead.
2. With any pear package but this one especially, is it possible to use it even if it has not been installed as a pear package? I want to use this on the host where my site is, and they do have pear, but not the Auth package. Will it work if I put Auth.php in a directory and also the Auth directory and set the include path so that I can include Auth/auth.php?
It *may* work but it's not guaranteed. Instead, you may use the web installer of PEAR so you can install the needed PEAR stuff under your documentroot. Just create let's say an 'include' folder on your account, grab the source of http://go-pear.php (without www!) and upload it to this directory. Make sure it is writable by php. Point your browser to this script on your account on the web and install the packages you need. After that, you'll need to set the include_path to include the directory 'include/PEAR' (NOT 'include'!). The best practice is to put this to the beginning of include_path so that your packages will get included first instead of the old ones on the server. This is cool because you'll be able to upgrade your packages whenever you want, regardless of the sysadmin. Regards, Norbert

« previous php.pear.general (#12501) next »