MDB 2.0
| From: | Lukas Smith | Date: | Sun, 03 Aug 2003 13:52:18 +0000 |
| Subject: | MDB 2.0 | ||
| Groups: | php.pear.dev php.pear.general | ||
| Request: | Send a blank email to pear-dev+get-19180@lists.php.net to get a copy of this message | ||
Hi,
just to let everyone know I am making some progress with MDB 2.0.
MDB 2.0 is now mostly refactored. I still need to read the LOB support
though. If you want to have a little sneak peek you can look at the
example.php in the example folder in CVS (MDB 2.0 is developed in HEAD
and MDB 1.x in the MDB_1 branch). It requires that you have run the
MDB_test.php from the MDB 1.x release tree beforehand if you want to
execute the script and get meaningful results.
Here you can see the modularization in action already, for example:
$db->loadExtended();
$array = $db->extended->queryAll($db, $query);
alternatively:
$extended =& $db->loadExtended();
$array = $extended->queryAll($db, $query);
With otherloading I can probably get rid of the call to
$db->loadExtended().
Most users preferred passing of a reference instead of storing a
reference in the module. So that is what I implemented.
So you could actually do:
$array = MDB_Extended::queryAll($db, $query);
Obviously its not quite that useful to use this for the Manager (and
Datatype) stuff:
MDB_Manager_Mysql::createDatabase($db, $name);
But either way this prevent recursive references like $db->datatype->db
being a reference to itself.
regards,
Lukas Smith
smith@backendmedia.com
_______________________________
BackendMedia
www.backendmedia.com
berlin@backendmedia.com
Linn Zwoch Smith GbR
Pariser Str. 44
D-10707 Berlin
Tel +49 30 83 22 50 00
Fax +49 30 83 22 50 07