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

[eluser]Unknown[/eluser]
Quote:What are the benefits of using this method over these two?

I wasn't able to find those--if I had I probably would have used one of them just to save time.

However, the advantage of this method over those is the following:

* Those still use the entire framework. They will run all hooks and load everything that would normally be loaded--which, depending on what you're doing, might be an advantage, but for unit tests it is a definite bummer.
* 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.) This method allows you to use CI like a big library, and doesn't require controllers for anything.


Messages In This Thread
Running CI without a web server (e.g., for cron scripts or unit tests) - by El Forum - 01-21-2009, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB