Dinamic Databases


Hello everyone.
I am needing a cake with CakePHP 3.4
My application has many databases, being arranged like this:



The db000 is always used in conjunction with another DB. That is, the system uses 2 db being the db000 along with another DB informed by the data returned in the login.

How can I do this with CakePHP 3?


I cannot being to rationalize why you need such a process. I have had several DBs setup in my application, ie (local, stage, live), but that is all controlled by the environments setup. For example, if I access mydomain.local, then CakePHP uses the local environment setup, etc.

I think it can be accomplished, but you would have to add some logic in the app.php file. For example db000.yourdomain.com could use the DB000 database.

If you explain further on how and why you need this, I can try to provide more help.


Akkaweb thanks for trying to help, and sorry for not contacting before.

The application is used by 112 clients each with its separate information in a proper DB. And in db000 are the permissions, users and other information common to all customers. When trying to migrate to CakePHP 3, I found a way to maintain this DB structure, where db000 will be used for login and client identification, where to start from there the system will be fed by the DB corresponding to the logged in client.

Sorry for my English, I know he is bad but I tried to be as detailed as possible.