Bug #16431 Updated: DB::connect() fails with Oracle, fix found

From: Date: Thu, 04 Apr 2002 21:26:23 +0000
Subject: Bug #16431 Updated: DB::connect() fails with Oracle, fix found
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5193@lists.php.net to get a copy of this message
ID: 16431 Updated by: cox@php.net Reported By: chengpan@attbi.com -Status: Open +Status: Bogus Bug Type: PEAR related Operating System: Linux 2.4 PHP Version: 4.1.2 New Comment: This is the expected behavior. To connect to Oracle with PEAR DB use the form: oci8://user:pass@database This is done so, to avoid complicate the DSN with something like: oci8://user:pass@/database. Something similar occurs with the ODBC driver, where the 'hostspec' is used as ODBC Data source, not really as host. -- Tomas V.V.Cox Previous Comments: ------------------------------------------------------------------------ [2002-04-04 12:17:56] chengpan@attbi.com The DB::connect() function in file pear/DB/oci8.php in php-4.1.2 and php-4.2.0RC2 cannot connect to an Oracle database if one follows the order for the arguments for this function. In this function, $dsninfo['hostspec'] is passed into OCILogon(). The correct parameter should be $dsninfo['database']. The following output of diff shows a fix: 94c94 < $database = $dsninfo['database']; --- > $hostspec = $dsninfo['hostspec']; 98,99c98,99 < if ($database) { < $conn = @$connect_function($user,$pw,$database); --- if ($hostspec) { > $conn = @$connect_function($user,$pw,$hostspec); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16431&edit=1

« previous php.pear.dev (#5193) next »