cvs: php3 /functions basic_functions.c php4/pear/DB ibase.php
| From: | Martin Kraemer | Date: | Mon, 25 Feb 2002 14:37:32 +0000 |
| Subject: | cvs: php3 /functions basic_functions.c php4/pear/DB ibase.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9446@lists.php.net to get a copy of this message | ||
martin Mon Feb 25 09:37:32 2002 EDT
Modified files:
/php4/pear/DB ibase.php
/php3/functions basic_functions.c
Log:
Not that it matters any more... Fix Bug #8097 in php3 too
Index: php4/pear/DB/ibase.php
diff -u php4/pear/DB/ibase.php:1.34 php4/pear/DB/ibase.php:1.35
--- php4/pear/DB/ibase.php:1.34 Mon Feb 18 03:37:08 2002
+++ php4/pear/DB/ibase.php Mon Feb 25 09:37:29 2002
@@ -16,7 +16,7 @@
// | Authors: Sterling Hughes <sterling@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: ibase.php,v 1.34 2002/02/18 08:37:08 ludoo Exp $
+// $Id: ibase.php,v 1.35 2002/02/25 14:37:29 cox Exp $
//
// Database independent query interface definition for PHP's Interbase
// extension.
@@ -46,18 +46,28 @@
function connect($dsninfo, $persistent = false)
{
- if (!DB::assertExtension('interbase'))
+ if (!DB::assertExtension('interbase')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
-
+ }
$this->dsn = $dsninfo;
$user = $dsninfo['username'];
- $pw = $dsninfo['password'];
+ $pw = $dsninfo['password'];
$dbhost = $dsninfo['hostspec'] ?
($dsninfo['hostspec'] . ':/' .
$dsninfo['database']) :
$dsninfo['database'];
$connect_function = $persistent ? 'ibase_pconnect' : 'ibase_connect';
+ $params = array();
+ $params[] = $dbhost;
+ $params[] = !empty($user) ? $user : null;
+ $params[] = !empty($pw) ? $pw : null;
+ $params[] = isset($dsninfo['charset']) ? $dsninfo['charset'] : null;
+ $params[] = isset($dsninfo['buffers']) ? $dsninfo['buffers'] : null;
+ $params[] = isset($dsninfo['dialect']) ? $dsninfo['dialect'] : null;
+ $params[] = isset($dsninfo['role']) ? $dsninfo['role'] : null;
+
+ /*
if ($dbhost && $user && $pw) {
$conn = $connect_function($dbhost, $user, $pw);
} elseif ($dbhost && $user) {
@@ -67,8 +77,11 @@
} else {
return $this->raiseError("no host, user or password");
}
+ */
+ $conn = call_user_func_array($connect_function, $params);
if (!$conn) {
- return $this->raiseError(DB_ERROR_CONNECT_FAILED);
+ return $this->raiseError(DB_ERROR_CONNECT_FAILED, null, null,
+ null, ibase_errmsg());
}
$this->connection = $conn;
return DB_OK;
Index: php3/functions/basic_functions.c
diff -u php3/functions/basic_functions.c:1.292 php3/functions/basic_functions.c:1.293
--- php3/functions/basic_functions.c:1.292 Wed May 30 10:58:52 2001
+++ php3/functions/basic_functions.c Mon Feb 25 09:37:29 2002
@@ -28,7 +28,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.292 2001/05/30 14:58:52 coar Exp $ */
+/* $Id: basic_functions.c,v 1.293 2002/02/25 14:37:29 martin Exp $ */
#include "php.h"
#include "modules.h"
#include "internal_functions.h"
@@ -472,7 +472,8 @@
/* Check if locale was changed and change it back
to the value in startup environment */
if (GLOBAL(locale_string) != NULL) {
- setlocale(LC_ALL, "");
+ setlocale(LC_ALL, "C");
+ setlocale(LC_CTYPE, "");
}
STR_FREE(GLOBAL(locale_string));
return SUCCESS;