Jonathan, I just pulled your bootstrapper into my app and really like it. The main reason I like it is because I can use this one file to control all of my different cron jobs. I have one question though. For some reason, everything dies after the following is called:
require(CRON_CI_INDEX); // Main CI index.php file
It never gets to the point of actually writing to the log files, as that code is just below. I have no exits or die statements in the called script, and my script runs just fine and produces the correct output. Any thoughts on why this could be happening?
Also, I updated a few things that may be of use to others:
I have a switch statement in my /system/application/config/config.php file that checks to see what server I’m on so that certain machine specific settings are set. So, I added a server switch so you can run:
% cron.php --run=/controller/method [--show-output] [--log-file=logfile] [--server=http-server]
The code I added for this is:
case '--server':
$_SERVER['SERVER_NAME'] = $value;
$required['--server'] = TRUE;
break;
I also updated the $CI_Root so that it would be server-independent (note the the bootstrap file lives in a scripts directory at the same level as application).
$CI_Root = dirname(__FILE__).'/../../index.php';