|
Posted by Chung Leong on 07/15/06 00:20
JDS wrote:
> But the config file has to be different on the working copy than on the
> server!
>
> How can a version control system deal with this problem without me having
> to tweak the "live" config file every time I migrate the app from the
> Subversion repository to the live server?
The easy answer is to simply not version control the config file. But
that's not a satisfactory answer, as there are clear benefits in
keeping the file in the repository. It remembers the date when you
change the config and give you a place to enter a reason explaining the
change. That could be very useful information when odd things start to
happen. The ability to roll back to a previous configuration is
obviously a big plus. Having the file under SVN also simplifies the
push process.
One possible strategy is to have separate config files under different
names. Depending on which environment the application is running in,
it'd load in the correct one. For example:
$conf = parse_ini_file("{$_SERVER['SERVER_NAME']}.ini", true);
I would keep both the production and the development version in SVN.
That way you wouldn't forget that a config change is necessary for some
newly developed code, since SVN will spot the change when you commit.
Navigation:
[Reply to this message]
|