Hi all,

I am going to develop a SAAS application in ZF2. I have Planned to have separate database for each clients. So, i need to configure multiple database ie,

One master db Which holds the client's login details and their database details. If a client login, then the application should connect to client's database, For the entire session of the client Db should be connected his database.

If he logs out then the system should connect to the master database again. I have surfed various resources, But many have explained how to configure multiple data base static in local.php.

I need to do this dynamically. I am using ZF2 and doctrine ORM in this project.

Kindly help me to do this. Or if my concept is wrong, Kindly suggest me any other alternative methods to do this in zend framework 2.

Thank you all