Split Config For Console App

I want to divide my config files for local and remote servers. I ve done this for main config but now i realized that i cant detect if console app is executing on local server. So how to do it? Thanks for all.

If you try to search, there has been lots of solutions suggested - you may choose, which suits u best:






Thank for answer, but i already found solution for split configs.

My question is little particular, im asking only: if application was started from console how to detect, that it running on local server?

For example, if app was run from web i can check:

if($_SERVER['SERVER_ADDR'] == ''){

//include local config


But it doesnt work in console app.

I created copy of main config, with parameters wich will work only on localhost, and now i need to do this with console config.

split the local and production config files for console app as you did for web app;

instead trying to detect in your console app if it’s running from local or production, you tell console app where you run it from via constant flag