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 ?
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 22.214.171.124 (example).
So I have to modify the code somehow like
if ( file_exists(’/Applications/MAMP/htdocs’) ) // My local machine
$host = “127.0.0.1”;
$host = “126.96.36.199”;
The problem is, I can’t use that php code in the config.inc.php to change
host = “localhost”
host = $host
Do you understand the question ? B)
Thank you very much !