Currently I am using dynamic database switching in Cakephp from the database config file. I am switching based on the subdomain ie: TEST.mysite.com and PROD.mysite.com.
How and where is the best place to test and redirect if there is a database connection?
Thanks,
kSeudo
The quick and dirty way to do this is to put a condition in the constructor. I say dirty because it creates a conditional config and with the introduction of a bug could leave your production app connected to a dev database.
To test connection you could put the following in the contructor for app_model.php