Environment variables

Permalink 1 user found helpful
Hi There,

My application/bootstrap/start.php file looks like this:
$app->detectEnvironment(
    array(
        'local' => array(
            'packer-virtualbox-iso'
        ),
        'staging' => array(
            'concrete5.staging.acato.net'
        )
    ));


Where should i but my custom database.php, app.php for each environment? I've created a folder called /application/config/local/database.php, /application/config/local/app.php but there files won't be called. Any idea?

brianvandelden
 
moleculeFFF replied on at Permalink Reply
moleculeFFF
Did you get any information regarding this ?
andrew replied on at Permalink Best Answer Reply
andrew
Sorry for the lack of documentation on this. It's coming. :\ If you prepend your config files with the key and then a period, it should load those based on environment. So not this:

application/config/local/database.php

But this:

application/config/local.database.php
jegra replied on at Permalink Reply
Can't get this to work. Dev domain is specified in the 'local' array key, but the local.database.php file seems to be ignored (settings in database.php keep getting loaded). Is there another setting/config value that needs to be set to get this to work?
andrew replied on at Permalink Reply
andrew
It's the hostname of the server, not the domain – so you'll want to type "hostname" from your terminal/shall and see what's that's set to, and make sure that's the value of the array.
jegra replied on at Permalink Reply
Worked - thanks, Andrew!