* <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;
}
$classname = 'DB_' . $type;
$obj = new $classname;
- return $obj; // XXX ADDREF
+ return $obj;
}
// }}}
* <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')) {
if (DB::isError($err)) {
return $err;
}
- return $obj; // XXX ADDREF
+ return $obj;
}
// }}}
} else {
$parsed['phptype'] = $dsn;
}
- return $parsed; // XXX ADDREF
+ return $parsed;
}
if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, &$arr)) {
$parsed['dbsyntax'] = $parsed['phptype'];
}
- return $parsed; // XXX ADDREF
+ return $parsed;
}
// }}}