Very frustrating problem with Auth 1.2.3 and/or DB 1.6.7
| From: | bclem at imaginative-enterprises dot com | Date: | Fri, 01 Oct 2004 07:34:33 +0000 |
| Subject: | Very frustrating problem with Auth 1.2.3 and/or DB 1.6.7 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14706@lists.php.net to get a copy of this message | ||
This code works on another server, this new server it does not.
This is the calling code:
<?php
require_once "Auth/Auth.php";
function loginFunction()
{
include "login.html";
}
$params = array(
"dsn" => "mysql://username:password@localhost/test",
"table" => "auth",
);
$a = new Auth("DB", $params, "loginFunction");
$a->start();
?>
The system never logs me in using the login form and I am recieving the
following errors in the debug file.
[01-Oct-2004 02:18:28] PHP Warning:
connect(DB/mysql:/username:password@localhost:3306/test.php): failed to open
stream: No such file or directory in /usr/share/pear/DB.php on line 371
You guy's see the problem? For some reason, it's taking the dsn parameter and
interpreting it as a file include. I have reinstalled both the DB and Auth
package to make sure that I have a non-corrupt install, but still the same
problem.
In the DB.php file for pear DB in the &connect function, the following is taking
place:
$dsninfo = DB::parseDSN($dsn);
$type = $dsninfo['phptype'];
If you do a print_r($dsninfo) you get:
Array
(
[phptype] => mysql
[dbsyntax] => mysql
[username] => tp_testdbadmin
[password] => chreW357
[protocol] => tcp
[hostspec] => localhost
[port] => 3306
[socket] =>
[database] => test
)
Array
(
[phptype] => mysql:/tp_testdbadmin:chreW357@localhost:3306/test
[dbsyntax] => mysql:/tp_testdbadmin:chreW357@localhost:3306/test
[username] =>
[password] =>
[protocol] =>
[hostspec] =>
[port] =>
[socket] =>
[database] =>
)
Why is it producing two array's with different info?
I think I may have found a bug. I don't know how to fix it though.
Thanks,
Brent
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.