Database IP as parameter

Hello,

I’m using Piwik with SVN on my local machine and on the online live system. All the files are the same. I want to insert my local data to localhost and on the live system to another database, which has a separate IP and is not localhost.

The problem is, I can’t use php code in the config.ini.php to check whether the script runs online or on the local machine and return a different IP . Can I use the bootstrap.php file to manage that somehow or is there another solution ?

Thank you very much for you help!

I don’t really understand what’s going on. sorry, can you try again?

ok, sure: I want to use the same piwik code on my local system (for testing) as on the server. On my local system I use localhost (127.0.0.1) as the database ip. For my online website I can’t use 127.0.0.1 as IP, because the database is not on the same server as my website. So if I would just upload my local piwik folder it won’t work, because online is no database at 127.0.0.1 - it is on 82.145.234.23 (example).

So I have to modify the code somehow like

if ( file_exists(’/Applications/MAMP/htdocs’) ) // My local machine
$host = “127.0.0.1”;
else
$host = “82.145.234.23”;

The problem is, I can’t use that php code in the config.inc.php to change

[database]
host = “localhost”

to

[database]
host = $host

Do you understand the question ? B)
Thank you very much !