cvs: php4 /pear DB.php /pear/DB common.php
| From: | Chuck Hagenbuch | Date: | Mon, 21 Aug 2000 14:37:47 +0000 |
| Subject: | cvs: php4 /pear DB.php /pear/DB common.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1292@lists.php.net to get a copy of this message | ||
chagenbu Mon Aug 21 07:37:47 2000 EDT
Modified files:
/php4/pear DB.php
/php4/pear/DB common.php
Log:
Make the DB classes work with call-time pass-by-reference disabled.
Index: php4/pear/DB.php
diff -u php4/pear/DB.php:1.25 php4/pear/DB.php:1.26
--- php4/pear/DB.php:1.25 Wed Jul 26 02:57:06 2000
+++ php4/pear/DB.php Mon Aug 21 07:37:47 2000
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.25 2000/07/26 09:57:06 ssb Exp $
+// $Id: DB.php,v 1.26 2000/08/21 14:37:47 chagenbu Exp $
//
// Database independent query interface.
//
@@ -188,7 +188,7 @@
* @return object a newly created DB object, or a DB error code on
* error
*/
- function &connect($dsn, $persistent = false) {
+ function &connect(&$dsn, $persistent = false) {
global $USED_PACKAGES;
$dsninfo = DB::parseDSN($dsn);
@@ -199,7 +199,7 @@
if (!$obj) {
return new DB_Error(DB_ERROR_NOT_FOUND);
}
- $err = $obj->connect(&$dsninfo, $persistent);
+ $err = $obj->connect($dsninfo, $persistent);
if (DB::isError($err)) {
return $err;
}
@@ -349,11 +349,11 @@
'username' => false,
'password' => false
);
- if (preg_match('|^([^:]+)://|', $dsn, &$arr)) {
+ if (preg_match('|^([^:]+)://|', $dsn, $arr)) {
$dbtype = $arr[1];
$dsn = preg_replace('|^[^:]+://|', '', $dsn);
// match "phptype(dbsyntax)"
- if (preg_match('|^([^\(]+)\((.+)\)$|', $dbtype, &$arr)) {
+ if (preg_match('|^([^\(]+)\((.+)\)$|', $dbtype, $arr)) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = $arr[2];
} else {
@@ -361,7 +361,7 @@
}
} else {
// match "phptype(dbsyntax)"
- if (preg_match('|^([^\(]+)\((.+)\)$|', $dsn, &$arr)) {
+ if (preg_match('|^([^\(]+)\((.+)\)$|', $dsn, $arr)) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = $arr[2];
} else {
@@ -370,21 +370,21 @@
return $parsed;
}
- if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, &$arr)) {
+ if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, $arr)) {
$parsed['database'] = $arr[2];
$dsn = $arr[1];
}
- if (preg_match('|^([^:]+):([^@]+)@?(.*)$|', $dsn, &$arr)) {
+ if (preg_match('|^([^:]+):([^@]+)@?(.*)$|', $dsn, $arr)) {
$parsed['username'] = $arr[1];
$parsed['password'] = $arr[2];
$dsn = $arr[3];
- } elseif (preg_match('|^([^:]+)@(.*)$|', $dsn, &$arr)) {
+ } elseif (preg_match('|^([^:]+)@(.*)$|', $dsn, $arr)) {
$parsed['username'] = $arr[1];
$dsn = $arr[3];
}
-
- if (preg_match('|^([^\+]+)\+(.*)$|', $dsn, &$arr)) {
+
+ if (preg_match('|^([^\+]+)\+(.*)$|', $dsn, $arr)) {
$parsed['protocol'] = $arr[1];
$dsn = $arr[2];
}
@@ -451,7 +451,7 @@
* @return int error code
*/
function fetchInto(&$arr, $getmode = DB_GETMODE_DEFAULT) {
- return $this->dbh->fetchInto($this->result, &$arr, $getmode);
+ return $this->dbh->fetchInto($this->result, $arr, $getmode);
}
// }}}
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.13 php4/pear/DB/common.php:1.14
--- php4/pear/DB/common.php:1.13 Mon Jul 24 01:24:14 2000
+++ php4/pear/DB/common.php Mon Aug 21 07:37:47 2000
@@ -50,7 +50,7 @@
// {{{ toString()
function toString() {
- $info = get_class(&$this);
+ $info = get_class($this);
$info .=
": (phptype=" . $this->phptype .
", dbsyntax=" . $this->dbsyntax .
@@ -231,7 +231,7 @@
*/
function executeMultiple($stmt, &$data) {
for ($i = 0; $i < sizeof($data); $i++) {
- $res = $this->execute($stmt, &$data[$i]);
+ $res = $this->execute($stmt, $data[$i]);
if (DB::isError($res)) {
return $res;
}
@@ -257,7 +257,7 @@
if (DB::isError($sth)) {
return $sth;
}
- $res = $this->execute($sth, &$params);
+ $res = $this->execute($sth, $params);
} else {
$res = $this->simpleQuery($query);
}
@@ -293,7 +293,7 @@
if (DB::isError($sth)) {
return $sth;
}
- $res = $this->execute($sth, &$params);
+ $res = $this->execute($sth, $params);
} else {
$res = $this->simpleQuery($query);
}
@@ -328,7 +328,7 @@
if (DB::isError($sth)) {
return $sth;
}
- $res = $this->execute($sth, &$params);
+ $res = $this->execute($sth, $params);
} else {
$res = $this->simpleQuery($query);
}