Different database configuration based on Host


#1

Hello people,

I am currently developing website that will use piwik as web analytic.
And one problem came up, maybe someone had it figured put earlier.

I need different database configuration for different hosts.
And piwk needs to select appropriate configuration in accordance with applications host

So if i start app on my localhost database settings will be

application host: localhost
host: localhost
user: user1
database: db1
pass: pass2

If I run int on test server the settings will be

application host: test.myapp.com
host: data.myapp.com
user: myapp_db
database: app_DB
pass: p@Ss


(vipsoft) #2

Use bootstrap.php to pick a different config folder depending on the host name.


(Matthieu Aubry) #3

Bootstrap doc can be found in: Include & Customize Piwik for your Project - Analytics Platform - Matomo