Can't call model from controller using CLI
HI, thanks again for Fuel. I managed to get the cli bootstrapworking.
https://github.com/compwright/codeigniter-cli-bootstrap with some modifications to the cron.php for some $server params for the fuel_constants.php file. I have it all running but the model will not load from the controller. I can run the query in the controller function, but can't call the model. I tried $this->load and $CI->load and both are not working. I can get around it without a model but curious of your thoughts. Thanks.
Comments
http://www.getfuelcms.com/forums/discussion/575/automating-database-backups/#Item_14
Nobody online seems to have same issue so thought it must be FUEL since it has some extra things involved.
It is odd that running from the cron it acts differently. Here is what I have. I am calling it every 3 minutes to test it.
*/3 * * * * root php /home/username/folder_behind_public/cron.php --run=/controller/function
Now, it prints the session out, but suddenly is running into the auth/login I have added in but that should not get called unless in the header of the view is where I put it. I do not call a view though. So any thoughts on why the command line works but the cron is running into what it seems is a login issue which means someone it is getting to the header file? Make sense? Strange heh. Hope it is simple.
Thanks
Keep in mind the --server option is not used.. they must have not updated the documentation. It is internally defaulted to localhost.. but you could hack the cron.php file and adjust it. I added these to cron.php to make FUEL happy.
$_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['SCRIPT_FILENAME'] = '/home/username/publicfolder/index.php'; //for us $_SERVER['SERVER_PORT'] = '443'; //HTTPS for us.. port 80 for HTTP
Hopefully this helps someone.