Friday 01 February 2008 10:35:00 am
You will encouter this problem when you are using your own configuration to suit your local development environment. There are three ways to address it.
You can ignore a specific file (or a group of files) by using "svn propset svn:ignore". However, your environment will not be updated when ini files are changed in the repository. If the communication between your team is good then you can use this technique:
You may have to deal with occasional conflicts, but this is part of the game. Resolving conflicts with SVN is easy and most conflicts can be resolved very quickly.
If you want to know more about conflict managment with SVN you will find this URL useful:
http://svnbook.red-bean.com/en/1.1/ch03s05.html#svn-ch-3-sect-5.4
Another way to deal with shared .ini files in local environments is to commit and checkout versioned ini file(s), but never committing changes that are specific to an environment. However, in my opinion, this is a less secure method and more prone to error.
When using a new configuration that you know needs to be adapted to each development environment, you can use a specific identifier in the .ini files. To indicate that the file contains environment-specific ini settings, developers append '.specific' to the end of the filename.
For example, if each developer needs to connect to his own database you could rename (using "svn rename") site.ini.append.php to site.ini.append.php.specific.
When a developer does a checkout or update of the project, he will download some .specific ini files. This will tell him that he has to rename them and update them.
Note that you can use a PHP or shell script that will automatically rename .specific files to the correct name.
You can use a build system.
Build systems are very common and provide a lot of features. Here is a list of a few build systems you might use for your projects:
Use the tool that best fits your needs.
By using a build tool you can automatically create a specific version of your application based upon the rules you have defined. This is just one example of the functionality available with build tools. It is up to you to define which tasks you want to be done in which context.
Before diving in, take time to define what you really need to build and deploy in your application. Here is a quick checklist you may find useful: