First you need to determine what a "local" environment is.
$env = $app->detectEnvironment(array( // everything that contains 'localhost' or '127.0.0.1' // in URL will be considered to run in local env. 'local' => array('localhost', '127.0.0.1'), ));
Then you need to create a directory called local in app/config . If you want to override database settings in local env. create a file: app/config/local/database.php and override the parameter in this file, for example:
'connections' => array( 'mysql' => array( 'username' => 'otherUserName', 'password' => 'otherPassword', ), ),
In this file you do not need to specify all parameters, only parameters other than the production / base configuration.
Additional information in official docs
source share