Welcome Guest, Not a member yet? Register   Sign In
Running CI without a web server (e.g., for cron scripts or unit tests)
#4

[eluser]awells527[/eluser]
Quote:* Those require you to create controllers for everything you might run on the command line. That means if you have a web project, you will somehow need to restrict access to those controllers from a normal web instance, but make them accessible to the CLI context. (Best way is probably with a check for a constant only defined by the CLI.)

That's the whole idea Smile. The method I posted on PHP Starter was to give all the functionality of CI, but on the command line...which is why I wanted the ability to create controllers for cron jobs, large import jobs, etc.

I believe testing for the presence of $_SERVER['REMOTE_ADDR'] is the best way to know if the script is being called from the web browser or the command line.


Messages In This Thread
Running CI without a web server (e.g., for cron scripts or unit tests) - by El Forum - 01-23-2009, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB