PDA

View Full Version : Setting a custom global variable


TalkVirginia
03-08-2010, 06:06 AM
Can anyone tell me if it would be feasible to set a global variable when I cron job is kicked off and have it picked up in a plugin? For example, I'd like to have a plugin be aware that a task was initiated by a cron job such as sending an email out. I was thinking maybe in $globals or $_SESSION.

Please advise.

Looks like I figured it out on my own... It was fairly simple actually. Not sure if this is the best way to do it but what I did was something like this at the top of the file that gets executed in my cron job:



$_SESSION['MY_VARIABLE'] = 1;