* @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);
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;
}
'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 {
}
} else {
// match "phptype(dbsyntax)"
- if (preg_match('|^([^\(]+)\((.+)\)$|', $dsn, &$arr)) {
+ if (preg_match('|^([^\(]+)\((.+)\)$|', $dsn, $arr)) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = $arr[2];
} else {
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];
}
* @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);
}
// }}}