Thread: The SQL Class
View Single Post
Old 01-17-2009, 05:23 PM   #52 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Already suggested it myself, but VI didn't want it for now.

Quote:
Originally Posted by Tanax View Post
Okey, after reading about their functions, I see why you thought it would sound silly or impractical. Indeed, it would be very impractical to have mysqli option in the mysql DB object. However, I've done a DB factory class, which would let you create a db object based off of what db you want, like:

$db = DB::getDatabase('mysql');

and it would then create a new DBmysql and return the instance.
It would then be easy to create other objects, such as DBmysqli, DBmysql_PDO, DBsqlite_PDO, etc.

But that's only if you guys want it. However, I think Orc will have to change the __construct in his class since it's checking if the class is an instance of DBmysql, and I don't know if someone else has done something using this class that would be affected by this change.

I would however be happy to change it, if you want.
And by "change it", I mean create the factory class.
__________________
Tanax is offline  
Reply With Quote