Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Separating out database configuration

edited July 2011 in Vanilla 2.0 - 2.8
Is there a way to take the database configuration information out of config.php -- I'd like to manage changes to that file locally using git and push them up to my production site using Capistrano.
Tagged:

Best Answer

  • Options
    LincLinc Detroit Admin
    edited July 2011 Answer ✓
    It's not meant to be managed that way. The best kludge I can think of is to add an include to your config.php that grabs the file with the database info in it (maybe config-db.php in the same folder). Just put the new config in the same format (as an array named $Configuration) and I'm pretty sure it'll work.

    //edit: The obvious problem here is that any change to your forum config is gonna overwrite config.php, which will not only un-sync with your git copy but also then break your database connection. You must make your config.php read-only for this to fly, and I don't know what other consequences that will bring.

Answers

  • Options
    LincLinc Detroit Admin
    edited July 2011 Answer ✓
    It's not meant to be managed that way. The best kludge I can think of is to add an include to your config.php that grabs the file with the database info in it (maybe config-db.php in the same folder). Just put the new config in the same format (as an array named $Configuration) and I'm pretty sure it'll work.

    //edit: The obvious problem here is that any change to your forum config is gonna overwrite config.php, which will not only un-sync with your git copy but also then break your database connection. You must make your config.php read-only for this to fly, and I don't know what other consequences that will bring.
  • Options
    Thanks for the answer! Is this something you would accept a patch for?
  • Options
    LincLinc Detroit Admin
    No, sorry, pretty sure that's not something we'd want to do in core.
  • Options
    OK, thanks. Thanks for all your hard work on the project, it's amazing.
Sign In or Register to comment.