cvs: pear /MDB2/MDB2/Driver/Reverse fbsql.php mysql.php pgsql.php
| From: | Lukas Smith | Date: | Fri, 14 Oct 2005 16:31:19 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Reverse fbsql.php mysql.php pgsql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35533@lists.php.net to get a copy of this message | ||
lsmith Fri Oct 14 12:31:19 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Reverse fbsql.php mysql.php pgsql.php
Log:
- use getConnection()
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Reverse/fbsql.php?r1=1.14&r2=1.15&ty=u
Index: pear/MDB2/MDB2/Driver/Reverse/fbsql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/fbsql.php:1.14 pear/MDB2/MDB2/Driver/Reverse/fbsql.php:1.15
--- pear/MDB2/MDB2/Driver/Reverse/fbsql.php:1.14 Mon Sep 26 10:43:44 2005
+++ pear/MDB2/MDB2/Driver/Reverse/fbsql.php Fri Oct 14 12:31:19 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: fbsql.php,v 1.14 2005/09/26 14:43:44 lsmith Exp $
+// $Id: fbsql.php,v 1.15 2005/10/14 16:31:19 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -86,12 +86,11 @@
* Probably received a table name.
* Create a result resource identifier.
*/
-
- $connected = $db->connect();
- if (PEAR::isError($connected)) {
- return $connected;
+ $connection = $db->getConnection();
+ if (PEAR::isError($connection)) {
+ return $connection;
}
- $id = @fbsql_list_fields($db->database_name, $result, $db->connection);
+ $id = @fbsql_list_fields($db->database_name, $result, $connection);
$got_string = true;
} elseif (MDB2::isResultCommon($result)) {
/*
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.32&r2=1.33&ty=u
Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.32 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.33
--- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.32 Fri Oct 7 06:28:59 2005
+++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Fri Oct 14 12:31:19 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.32 2005/10/07 10:28:59 lsmith Exp $
+// $Id: mysql.php,v 1.33 2005/10/14 16:31:19 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -228,11 +228,11 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $connected = $db->connect();
- if (PEAR::isError($connected)) {
- return $connected;
+ $connection = $db->getConnection();
+ if (PEAR::isError($connection)) {
+ return $connection;
}
- $id = @mysql_list_fields($db->database_name, $result, $db->connection);
+ $id = @mysql_list_fields($db->database_name, $result, $connection);
$got_string = true;
} elseif (MDB2::isResultCommon($result)) {
/*
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Reverse/pgsql.php?r1=1.25&r2=1.26&ty=u
Index: pear/MDB2/MDB2/Driver/Reverse/pgsql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.25 pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.26
--- pear/MDB2/MDB2/Driver/Reverse/pgsql.php:1.25 Fri Oct 14 06:43:20 2005
+++ pear/MDB2/MDB2/Driver/Reverse/pgsql.php Fri Oct 14 12:31:19 2005
@@ -42,7 +42,7 @@
// | Author: Paul Cooper <pgc@ucecom.com> |
// +----------------------------------------------------------------------+
//
-// $Id: pgsql.php,v 1.25 2005/10/14 10:43:20 lsmith Exp $
+// $Id: pgsql.php,v 1.26 2005/10/14 16:31:19 lsmith Exp $
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -305,9 +305,14 @@
return $db;
}
+ $connection = $db->getConnection();
+ if (PEAR::isError($connection)) {
+ return $connection;
+ }
+
$field_name = @pg_field_name($resource, $num_field);
- $result = @pg_query($db->connection, "SELECT f.attnotnull, f.atthasdef
+ $result = @pg_query($connection, "SELECT f.attnotnull, f.atthasdef
FROM pg_attribute f, pg_class tab, pg_type typ
WHERE tab.relname = typ.typname
AND typ.typrelid = f.attrelid
@@ -318,7 +323,7 @@
$flags = ($row[0] == 't') ? 'not_null ' : '';
if ($row[1] == 't') {
- $result = @pg_query($db->connection, "SELECT a.adsrc
+ $result = @pg_query($connection, "SELECT a.adsrc
FROM pg_attribute f, pg_class tab, pg_type typ, pg_attrdef a
WHERE tab.relname = typ.typname AND typ.typrelid = f.attrelid
AND f.attrelid = a.adrelid AND f.attname =
'$field_name'
@@ -330,7 +335,7 @@
} else {
$flags = '';
}
- $result = @pg_query($db->connection, "SELECT i.indisunique, i.indisprimary,
i.indkey
+ $result = @pg_query($connection, "SELECT i.indisunique, i.indisprimary, i.indkey
FROM pg_attribute f, pg_class tab, pg_type typ, pg_index i
WHERE tab.relname = typ.typname
AND typ.typrelid = f.attrelid