#25389 [NEW]: DB::Pear (sybase.php)
| From: | cesararnold at yahoo dot com dot br | Date: | Sat, 06 Sep 2003 05:12:41 +0000 |
| Subject: | #25389 [NEW]: DB::Pear (sybase.php) | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-21108@lists.php.net to get a copy of this message | ||
From: cesararnold at yahoo dot com dot br
Operating system: Win2k
PHP version: 4.3.2
PHP Bug Type: PEAR related
Bug description: DB::Pear (sybase.php)
Description:
------------
I would like to ask you to increase the below lines of code into
sybase.php file from Pear::DB, if possible of course, because when I try
to connect using a DSN including the database name, sybase.php "connect"
function does change to the database informed and I need to do it calling
@sybase_select_db(). the code could be added at "connect".
A similar code exists on mssql.php class at "connect" function.
So, all times when I update my pear package I need to include it into
sybase.php again.
The code is below:
Thanks for your help.
// }}}
// {{{ connect()
/**
* Connect to a database and log in as the specified user.
*
* @param $dsn the data source name (see DB::parseDSN for syntax)
* @param $persistent (optional) whether the connection should
* be persistent
* @access public
* @return int DB_OK on success, a DB error on failure
*/
function connect($dsninfo, $persistent = false)
{
if (!DB::assertExtension('sybase') &&
!DB::assertExtension('sybase_ct'))
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
$this->dsn = $dsninfo;
$user = $dsninfo['username'];
$pw = $dsninfo['password'];
$interface = $dsninfo['hostspec'] ? $dsninfo['hostspec'] :
'localhost';
$connect_function = $persistent ? 'sybase_pconnect' :
'sybase_connect';
if ($interface && $user && $pw) {
$conn = $connect_function($interface, $user, $pw);
} else {
$conn = FALSE;
}
if (!$conn) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED);
}
/////////////// INCLUDE HERE !!! PLEASE /////////////////
if ($dsninfo['database']) {
if (!@sybase_select_db($dsninfo['database'], $conn)) {
return $this->raiseError(DB_ERROR_NODBSELECTED, null,
null, null, sybase_get_last_message());
}
$this->_db = $dsninfo['database'];
}
/////////////// INCLUDE HERE !!! THANKS /////////////////
$this->connection = $conn;
return DB_OK;
}
--
Edit bug report at http://bugs.php.net/?id=25389&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25389&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25389&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25389&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25389&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25389&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25389&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25389&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25389&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25389&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25389&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25389&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25389&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25389&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25389&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25389&r=gnused