cvs: /php4/pear DB.php

From: Date: Wed, 09 Feb 2000 19:41:44 +0000
Subject: cvs: /php4/pear DB.php
Groups: php.version4 
Request: Send a blank email to php-version4+get-9992@lists.php.net to get a copy of this message
andrei Wed Feb 9 11:41:44 2000 EDT Modified files: /php4/pear DB.php Log: Return by reference, where necessary. Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.12 php4/pear/DB.php:1.13 --- php4/pear/DB.php:1.12 Wed Feb 9 11:04:17 2000 +++ php4/pear/DB.php Wed Feb 9 11:41:13 2000 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: DB.php,v 1.12 2000/02/09 19:04:17 ssb Exp $ +// $Id: DB.php,v 1.13 2000/02/09 19:41:13 andrei Exp $ // // Database independent query interface. // @@ -154,7 +154,7 @@ * <return type="object">a newly created DB object, or a DB error * code on error</return> */ - function factory($type) { + function &factory($type) { global $USED_PACKAGES; // "include" should be replaced with "import" once PHP gets it $pkgname = 'DB/' . $type; @@ -167,7 +167,7 @@ } $classname = 'DB_' . $type; $obj = new $classname; - return $obj; // XXX ADDREF + return $obj; } // }}} @@ -188,12 +188,12 @@ * <return type="object">a newly created DB object, or a DB error * code on error</return> */ - function connect($dsn, $persistent = false) { + function &connect($dsn, $persistent = false) { global $USED_PACKAGES; $dsninfo = DB::parseDSN($dsn); $type = $dsninfo['phptype']; - // "include" should be replaced with "use" once PHP gets it + // "include" should be replaced with "import" once PHP gets it $pkgname = 'DB/' . $type; if (!is_array($USED_PACKAGES) || !$USED_PACKAGES[$pkgname]) { if (!@include($pkgname . '.php')) { @@ -208,7 +208,7 @@ if (DB::isError($err)) { return $err; } - return $obj; // XXX ADDREF + return $obj; } // }}} @@ -354,7 +354,7 @@ } else { $parsed['phptype'] = $dsn; } - return $parsed; // XXX ADDREF + return $parsed; } if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, &$arr)) { @@ -385,7 +385,7 @@ $parsed['dbsyntax'] = $parsed['phptype']; } - return $parsed; // XXX ADDREF + return $parsed; } // }}}

« previous php.version4 (#9992) next »