• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter Cron Jobs

I am really excited about the new addition that allows you to execute CodeIgniter code from command line.

As of right now, all of my cron jobs are in horrible un-codeignited PHP code and I'm re-writing them in CodeIgniter (so many less lines!).

So let's say I go:

/usr/bin/php index.php cron this_cron_function
In this_cron_function, how can I determine whether or not this is a command line request? For example, what's from stopping a user from going to mysite.com/index.php/cron/this_cron_function and executing the entire procedure?

Is there any kind of way to determine the difference in requests? How can I ensure that the cron.php Controller can only be accessed and executed by a system command?


User Guide: Input. Read the very bottom Smile

Damn. Smile I can read English.

Haha, thanks for pointing that out. I knew it must be something simple I'm missing. Thanks much.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.