Cron Library |
[eluser]Phil_B[/eluser]
Version 0.5 should be up soon. I'm open to any suggestions for executing the jobs. The ME method works perfectly for me but I know others will want to use it in other ways. I would like to keep it platform independent so if I use exec, the parameter for forking would have to come from the users database entry.
[eluser]sophistry[/eluser]
job execution options OTTOMH (i have used all of these at one time or another): ME run (current implementation) function call by variable $$funcname method call by variable $obj->$methname eval($code) file_get_contents($url) redirect($url) call_user_func() call_user_func_array() exec() (and others like it, shell(), passthru(), etc...) i tend to favor call_user_func_array()because it is the most flexible for calling things "internally" to the existing CI stack. file_get_contents() and redirect() will create a new CI process (assuming you are running CI jobs on your existing site). eval() i generally avoid. cheers.
[eluser]yannyannyann[/eluser]
I am new to cron jobs ... I implemented this : Code: function config( $var = '' ) How can I verify the cron is done ?
[eluser]sophistry[/eluser]
finally getting around to implementing this library. it's really cool except for a few errors i encountered and fixed: the constructor $time->now setting needs to be changed so strtotime() can calculate the timestamp properly (it was giving me -1): Code: $this->now = strtotime(date('m/d/Y H:i:').'00 +1 minute'); // Round up to the next minute i changed the line in run_jobs() where this library uses ME to run the jobs to a more generic file_get_contents(). this line will call any controller in your site (creates a new http process, but it means you don't have to have ME to use this cool cron setup): Code: // changed job caller to use file_get_contents() the expand() function uses a weird reference trick in the foreach loop to avoid creating another variable. it was causing errors for me so i just created a temporary array called $expanded_cron and built the arrays in there and then returned that variable: Code: /**
[eluser]dardar[/eluser]
Download link is not working, maybe someone could upload it somethere else or maybe it's board's problem?
[eluser]InsiteFX[/eluser]
All WIKI files have been moved here to the new WIKI CodeIgniter WIKI - GitHub
|
Welcome Guest, Not a member yet? Register Sign In |