Hi Everyone
First I want to excuse if this task has already been discussed. I do not want to produce overhead ;-)
I am working with PHP and MySQL all day long, and have to work with several customer databases. Therefore I have every database in the config file. Adding a new database is really inconvinient, and I simply hate the way it is done. Not because it is not useful, but simply because I have to leave the Browser window. After adding a 6th database this morning, I decided to do something against it. Here is what I have done:
The Database configurations are being stored in a database table. In the config.inc.php the $cfgServer entries have been removed, instead some $cfgDBServer entries have been written, to select the database in use. Adv_Auth entries can either be entered globally by setting
$cfgDBServer["adv_auth"]
or database specific by setting the corresponding database entry.
libraries/common.lib.php has been expanded by adding a short (starting at about line 300 ) If clause which checks for $cfgDBServers being TRUE, unsetting $cfgServer if this is the case, and reading the entries from the Database table. Therefore existing configurations have to be proted to the database, I guess you could uncomment the unset($cfgServers) statement without any problems, this was simply not what I wanted it to do.
Localization in the error messages is not being done by now, the errors occur in english.
I append the additions to common.lib.php and config.inc.php as diff against the current Release Candidate ( 2.2.2-rc1 ) version. I do not know if it works against CVS, but should do so without any problems. Keep me posted, if it works and what you think of it.
CU Roland