01-18-2011, 01:32 AM
[eluser]Devon Lambert[/eluser]
Has anyone had success running Codeigniter from the Command Line. I am specifically interested in this functionality for use in a Cron setup, but I may have other uses in the future.
2 problems I've run into are errors being produced by the autoload functionality added to my config file and also errors produced by some of the constant variables that I have in my APP/config/constants.php file; The main two being SERVER_NAME and QUERY_STRING. I believe these errors are occurring because I am not running the code from the browser. That being said, I don't want to have to go through the entire site and re-factor code to make cron work correctly. There must be an easy, and secure, method for making this play nice with my current CI setup. It should be noted that I am using CI 2.0, although I suspect the solutions should work all the same.
Before you scold me, I have done some extensive searching over the past few days.
I have tried:
1) Codeigniter Wiki Post for making use of Cron
http://codeigniter.com/wiki/Category:Adv...ronScript/
and:
2) Codeigniter Cron Bootstrapper
http://codeigniter.com/wiki/Cron_job_bootstrapper/
and even this:
3) Phil's CLI Class
https://github.com/philsturgeon/codeigniter-cli
Has anyone used either of these two with success?
1) Cron Library
Checked this out, but it seems a bit unreliable, no?
http://ellislab.com/forums/viewthread/108154/P20/
2) Crontab Library
http://biozshock.blogspot.com/2010/03/co...brary.html
Thanks all.
Has anyone had success running Codeigniter from the Command Line. I am specifically interested in this functionality for use in a Cron setup, but I may have other uses in the future.
2 problems I've run into are errors being produced by the autoload functionality added to my config file and also errors produced by some of the constant variables that I have in my APP/config/constants.php file; The main two being SERVER_NAME and QUERY_STRING. I believe these errors are occurring because I am not running the code from the browser. That being said, I don't want to have to go through the entire site and re-factor code to make cron work correctly. There must be an easy, and secure, method for making this play nice with my current CI setup. It should be noted that I am using CI 2.0, although I suspect the solutions should work all the same.
Before you scold me, I have done some extensive searching over the past few days.
I have tried:
1) Codeigniter Wiki Post for making use of Cron
http://codeigniter.com/wiki/Category:Adv...ronScript/
and:
2) Codeigniter Cron Bootstrapper
http://codeigniter.com/wiki/Cron_job_bootstrapper/
and even this:
3) Phil's CLI Class
https://github.com/philsturgeon/codeigniter-cli
Has anyone used either of these two with success?
1) Cron Library
Checked this out, but it seems a bit unreliable, no?
http://ellislab.com/forums/viewthread/108154/P20/
2) Crontab Library
http://biozshock.blogspot.com/2010/03/co...brary.html
Thanks all.