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:

http://www.yiiframework.com/wiki/73/use-different-environments-development-production-etc-in-your-app-with-easy-environment-class/

http://www.yiiframework.com/wiki/289/use-application-on-production-development-environment-without-making-changes/

http://www.yiiframework.com/wiki/32/manage-application-configuration-in-different-modes/

http://www.yiiframework.com/wiki/73/use-different-environments-development-production-etc-in-your-app-with-easy-environment-class/

Cheers

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'] == '127.0.0.1'){

//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