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.

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

  • LincLinc 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

  • LincLinc 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.
  • Thanks for the answer! Is this something you would accept a patch for?
  • LincLinc Admin
    No, sorry, pretty sure that's not something we'd want to do in core.
  • OK, thanks. Thanks for all your hard work on the project, it's amazing.
Sign In or Register to comment.