I have a web-based application that I would like to open source by using a public svn host, the problem is that the project contains configuration files which I would rather keep some of the values private. What is the best way of handling this?
Ideally I would like to be able to import revisions without having to replace the file with a file stripped of private data every time.
Maintain two configuration files:
config.phpconfig.dist.phpconfig.phpis your live settings file where you store your runtime configuration with private data, paths and such.config.dist.phpis the same file but with default or dummy configuration settings.Whenever your project gets a new configuration setting, you test it in your live
config.phpfile and afterwards copy it into the .dist file, giving it a dummy value.Set your version control to ignore
config.php.That way, you will never have private data in your repository, but somebody checking out the project has a default configuration file to start right away.