Installer using wrong database config for environment

edited August 2014 in Bug Reports
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

  • edited 3:41AM
    How are you determining your environments? Are you using the fuel/application/config/environments.php file? If so, the CLI doesn't necessarily have the same $_SERVER['SERVER_NAME'] variable and this can be better configured in the bootstrap index.php file under the area where it says:
    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.
  • edited 3:41AM
    I was attempting to install it using the installer via the URL, but the CLI produces the same end.

    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.
  • edited 3:41AM
    What is the command you are running?

    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.
Sign In or Register to comment.