[eluser]Clooner[/eluser]
Calling controllers and methods from the cli is now directly supported by CI which is a great thing!
My question is how do I prevent the script from executing when being accessed by a http request. e.g. when someone tries to call the controller method directly by accessing the url.
Code:
http://example.com/index.php/cron_controller/method_every_minute/
I can use the same system I did before by creating a symbolic link to index.php name it cron.php and check if the file being accessed is cron.php in the controller construct. Then deny access to the cron.php from the web.
There are several other ways to check some server variables like $argc and $argv and check STDIN or maybe CI2 contains a helper function to do just this.
My method seems a bit verbose to me! How do you guys prevent access to cron job controllers from the web?