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.
Page 1 of 1
Split Config For Console App
#2
Posted 21 January 2013 - 09:05 AM
If you try to search, there has been lots of solutions suggested - you may choose, which suits u best:
http://www.yiiframew...ironment-class/
http://www.yiiframew...making-changes/
http://www.yiiframew...ifferent-modes/
http://www.yiiframew...ironment-class/
Cheers
http://www.yiiframew...ironment-class/
http://www.yiiframew...making-changes/
http://www.yiiframew...ifferent-modes/
http://www.yiiframew...ironment-class/
Cheers
Yii extension: Captcha Extended
Greatest discoveries in 22nd century will be about the gravitation. | Homepage: http://www.synet.sk
Greatest discoveries in 22nd century will be about the gravitation. | Homepage: http://www.synet.sk
#3
Posted 21 January 2013 - 10:34 AM
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:
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.
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.
#4
Posted 21 January 2013 - 10:52 AM
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
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
when i ask, if my question does not make sense, don't blame on me, coz i am new here to learn yii;
when i answer, if my answer does not make sense, don't blame on me, coz i am trying to answer to be answered;
ok, i'm covered to mess up and fooling around, yeehaw ...
when i answer, if my answer does not make sense, don't blame on me, coz i am trying to answer to be answered;
ok, i'm covered to mess up and fooling around, yeehaw ...
Share this topic:
Page 1 of 1

Help















