Sometimes, we will want background processes, periodic tasks, or maintenance tasks to occur. This is where FuelPHP tasks come in handy. They can be run via the command-line tool, or set up as a periodic task on Windows, or cron job on Mac OSX and *nix. They can call upon modules and other classes just like controllers can.
Tasks should be placed in the
fuel/app/tasks folder and, by default, only a
run() method needs to be defined within the class. If you need other methods, these can be added in the usual way for PHP classes.
The tasks are called using the Oil
refine command. FuelPHP comes with an example task called
robots and will be included in the
To call the main method of the robot task, you can run the following ...