cvs: pear /MDB pear_wrapper.php
| From: | Lukas Smith | Date: | Wed, 17 Jul 2002 14:30:08 +0000 |
| Subject: | cvs: pear /MDB pear_wrapper.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5161@lists.php.net to get a copy of this message | ||
lsmith Wed Jul 17 10:30:08 2002 EDT
Modified files:
/pear/MDB pear_wrapper.php
Log:
updated because of MDB API changes
Index: pear/MDB/pear_wrapper.php
diff -u pear/MDB/pear_wrapper.php:1.13 pear/MDB/pear_wrapper.php:1.14
--- pear/MDB/pear_wrapper.php:1.13 Wed Jul 10 06:58:06 2002
+++ pear/MDB/pear_wrapper.php Wed Jul 17 10:30:08 2002
@@ -42,12 +42,12 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: pear_wrapper.php,v 1.13 2002/07/10 10:58:06 lsmith Exp $
+// $Id: pear_wrapper.php,v 1.14 2002/07/17 14:30:08 lsmith Exp $
//
// PEAR DB Wrapper for MDB.
//
-
-require_once "MDB.php";
+
+require_once (dirname(__FILE__)."/MDB.php");
class DB
{
@@ -85,11 +85,6 @@
return MDB::isManip($query);
}
- function isWarning($value)
- {
- return MDB::isWarning($value);
- }
-
function errorMessage($value)
{
return MDB::errorMessage($value);
@@ -137,7 +132,7 @@
function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = NULL)
{
- $this->dbh->fetchInto($this->result, &$arr, $fetchmode, $rownum);
+ $arr = $this->dbh->fetchInto($this->result, $fetchmode, $rownum);
if(is_array($arr)) {
return $arr;
}
@@ -148,7 +143,11 @@
function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = NULL)
{
- return $this->dbh->fetchInto($this->result, &$arr, $fetchmode, $rownum);
+ $arr = $this->dbh->fetchInto($this->result, $fetchmode, $rownum);
+ if(MDB::isError($arr)) {
+ return $arr;
+ }
+ return (DB_OK);
}
function numCols()
@@ -228,8 +227,7 @@
function quote($string)
{
- $this->MDB_object->quote($string);
- return $string;
+ return $this->MDB_object->quote($string);
}
function provides($feature)
@@ -381,11 +379,7 @@
function nextId($seq_name, $ondemand = TRUE)
{
- $return = $this->MDB_object->nextId($seq_name, $value, $ondemand);
- if(MDB::isError($return)) {
- return $return;
- }
- return $value;
+ return $this->MDB_object->nextId($seq_name, $ondemand);
}
function createSequence($seq_name)
@@ -412,24 +406,18 @@
{
switch ($type) {
case 'tables':
- $this->MDB_object->listTables($result);
- break;
+ return $this->MDB_object->listTables();
case 'views':
- $this->MDB_object->listViews($result);
- break;
+ return $this->MDB_object->listViews();
case 'users':
- $this->MDB_object->listUsers($result);
- break;
+ return $this->MDB_object->listUsers();
case 'functions':
- $this->MDB_object->listFunctions($result);
- break;
+ return $this->MDB_object->listFunctions();
case 'databases':
- $this->MDB_object->listDatabases($result);
- break;
+ return $this->MDB_object->listDatabases();
default:
return $this->raiseError(DB_ERROR_UNSUPPORTED);
}
- return $result;
}
}
?>