title: Cakephp3 app subdomain sharing same application code but different databse
body: <p>I want to build multi-tenant web application with CakePHP 3 like this <a href="http://www.orangescrum.com/" rel="nofollow">http://www.orangescrum.com/</a>, which is also written in CakePHP. </p>
  
  <p>Each tenant will have separate subdomain and separate database, only the application source code will be same for all sub domains. The domains will have their own folder like <code>x.domain.com</code>, <code>y.domain.com</code> mapping to folder <code>x, y, z</code>. </p>
  
  <p>I don't want to have duplicate application source code in all subdomains. I want to reuse same application code for all. </p>
  
  <p>When each subdomain in requested how can I use same application code but different database? Any suggestions for any kind of implementation are welcome.</p>