Just one comment...
Maybe it would be cleaner to separate `db config` in a separated file, just as `$params`.
That would help sharing (and versioning) the main config file wile each developer has it's own database configuration (ignored by CVS) without problem.