![]() |
DB wrapper for framework
Hi!
I got really interested in frameworks, especially the MVC pattern, so I followed a tutorial on how to create an own framework. Works great! Only one thing, or well, actually I have a couple of questions, but let's just take first thing's first. The tutorial showed how to create a Database class, but that was only for MySQL. I'm only using MySQL so for me it won't be a problem, but I would love to learn how to create some kind of wrapper instead. So that it gets the desired DB engine(ofcourse you have to write seperate classes for each engine) based on what the user writes in the configuration file. Right now it's used like this: my bootstrap file: PHP Code:
PHP Code:
Basicly, I want the $this->db to become an instance of DBmysql if that's specified, so that the Database class only works like a.. wrapper or gateway? Or will I have to do this in another way for it to work? EDIT: I already have functions to check if a config item is set. I only need help with the actual Database wrapper and how to accomplish so $this->db becomes instance of the specified engine |
| All times are GMT. The time now is 11:00 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0