in reply to Single file oriented for different usage

How about a run-string parameter with one of three possible values ( 'EXP', 'DEMO', 'LIVE'). Your single configuration file could then have EXP_DB_HOST, DEMO_DB_HOST and LIVE_DB_HOST as opposed to DB_HOST as a field.

Common fields would remain consistant, but you'd have to add a little intellegence when getting a detail that can vary.

  • Comment on Re: Single file oriented for different usage

Replies are listed 'Best First'.
Re^2: Single file oriented for different usage
by arbingersys (Pilgrim) on Feb 26, 2008 at 18:29 UTC

    (It begins to look a little like #ifdef/#include, doesn't it? :)

    My mind sort of wandered in this direction, and it would work for some of the problem, definitely. But I wouldn't want the username/passwords for the online demo in the source, obviously.

    I've realized that my initial query was a bit unclear, and what I'm really asking is whether a single file could be diced up while 'Make'-ing a target to include the appropriate differences, i.e. EXP, LIVE, DEMO. Sorry about that.

    A blog among millions.