Installer using wrong database config for environment
I am trying to install an advanced module of mine on a local development copy of a site, however, when I run the installer it attempts to run installation on the default database configuration file instead of the environment specific configuration.
The correct environment is being set and the data is otherwise being pulled from the correct database.
Comments
if (defined('STDIN'))...
One way to maybe do a quick test is to simply echo out the environment value right after it is set in the index.php bootstrap file and call it via the CLI to see what is outputted.
I placed the following code after the environment definition
if (defined('STDIN')) { echo ENVIRONMENT; die(); }
which produces: 'development', which is correct.
When I remove the code snippet, an error of "Unknown Database" is thrown which is the database specified in the default database.php config.
I think next steps may be to get a little dirty and debug directly in the DB.php CI file. You'll see that around line 35 it includes the database config file and how it determines the path to that file.