cvs: pear /MDB MDB.php

From: Date: Thu, 20 Jun 2002 12:04:03 +0000
Subject: cvs: pear /MDB MDB.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4705@lists.php.net to get a copy of this message
lsmith Thu Jun 20 08:04:03 2002 EDT Modified files: /pear/MDB MDB.php Log: introduced global array $databases that stores references to all db objects Index: pear/MDB/MDB.php diff -u pear/MDB/MDB.php:1.14 pear/MDB/MDB.php:1.15 --- pear/MDB/MDB.php:1.14 Wed Jun 12 09:08:52 2002 +++ pear/MDB/MDB.php Thu Jun 20 08:04:02 2002 @@ -16,7 +16,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: MDB.php,v 1.14 2002/06/12 13:08:52 lsmith Exp $ +// $Id: MDB.php,v 1.15 2002/06/20 12:04:02 lsmith Exp $ // // Database independent query interface. // @@ -215,11 +215,16 @@ if (!class_exists($classname)) { return PEAR::raiseError(NULL, DB_ERROR_NOT_FOUND, - NULL, NULL, NULL, 'DB_Error', TRUE); + NULL, NULL, NULL, 'MDB_Error', TRUE); } @$db =& new $classname; - + + global $databases; + $database = count($databases)+1; + $databases[$database] = &$db; + $db->database = $database; + return $db; } @@ -343,6 +348,12 @@ NULL, NULL, NULL, 'MDB_Error', TRUE); } $db = new $class_name; + + global $databases; + $database = count($databases)+1; + $databases[$database] = &$db; + $db->database = $database; + $db->include_path = $include_path; if (isset($dsninfo["hostspec"])) { $db->host = $dsninfo["hostspec"];

« previous php.pear.cvs (#4705) next »