]> granicus.if.org Git - php/commitdiff
Make the DB classes work with call-time pass-by-reference disabled.
authorChuck Hagenbuch <chagenbu@php.net>
Mon, 21 Aug 2000 14:37:47 +0000 (14:37 +0000)
committerChuck Hagenbuch <chagenbu@php.net>
Mon, 21 Aug 2000 14:37:47 +0000 (14:37 +0000)
pear/DB.php

index 97e0f7077a033d121d48596f738f4fe715362102..2e53f79e6d1436c7a7afe79a4811a04893aef9df 100644 (file)
@@ -188,7 +188,7 @@ class DB {
         * @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 @@ class DB {
                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 @@ class DB {
                        '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 @@ class DB {
                        }
                } 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 @@ class DB {
                        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 @@ class DB_result {
         * @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);
     }
 
     // }}}