that piece of logic probably belongs in your bootstrap file. app/cli.php public/index.php for instance. I have multiple config files based and include the right one based on the set ENVIRONMENT which might be dev, stage, live for now. got (dev|stage|live).config.php files in the app/config folder.