Re: [ErrorSystem-devel] db layer
Status: Planning
Brought to you by:
sonicmctails
From: <son...@ss...> - 2003-12-25 22:58:41
|
I've got a better idea which makes it also alot easier for anyone to make a new layer. We have the configuration variable in the file be what file is loaded. So if $['CONFIG'] = mysql, then database-mysql.php will be loaded. If that was changed to postgresql then database-postgresql.php. Then all that would have to be done is set the include line to load the right file. I've seen this system used liek that with great success on Invision Power Board, and PHPBB (though I haven't dug into it's code to make sure). > In fact, the constructor, I would have prefer something like this: > Class DBL{ > function DBL($user, $pass, $name, $server="localhost", $port=3306, > $type="MySQL") { > $this->user=$user; > $this->pass=$pass; > $this->name=$name; > $this->server=$server; > $this->port=$port; > $this->type=$type; > switch ($type) { > case "MySQL": > include("mysql.inc.php"); > break; > case "ProgresSQL": > include("progress.inc.php"); > break; > //and so on > } > } > } > Should this work? What do you think about that? > > Stephane > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > ErrorSystem-devel mailing list > Err...@li... > https://lists.sourceforge.net/lists/listinfo/errorsystem-devel > |