Description

Schedules task execution.

A scheduled task is a callback that should be executed every so often (such as daily, weekly, monthly, etc.). They are registered by extending {@link \Piwik\Plugin\Tasks}.

Tasks are executed when the core:archive command is executed.

Examples

Scheduling a task**

class Tasks extends \Piwik\Plugin\Tasks { public function schedule() { $this->hourly('myTask'); // myTask() will be executed once every hour } public function myTask() { // do something } }

Executing all pending tasks**

$results = $scheduler->run(); $task1Result = $results[0]; $task1Name = $task1Result['task']; $task1Output = $task1Result['output'];

echo "Executed task '$task1Name'. Task output:\n$task1Output";

Type hierarchy

Class usage:

This class is used in:
Class Package
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15477.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15477.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15414.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15414.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15307.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15307.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 6265.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 6265.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15534.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15534.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14944.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14944.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14939.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14939.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14054.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14054.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13835.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13835.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik dev-master
Piwik\Plugins\CoreAdminHome\API
piwik/piwik dev-master
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15240.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15240.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 15176.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 15176.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14744.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14744.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14612.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14612.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14428.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14428.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14395.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14395.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14267.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14267.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14223.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14223.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14208.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14208.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 14188.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 14188.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13989.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13989.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13880.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13880.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13383.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13383.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13325.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13325.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13272.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13272.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 13070.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 13070.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 11942.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 11942.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 11058.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 11058.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 10801.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 10801.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 7105.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 7105.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 5711.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 5711.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 539.x-dev
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 539.x-dev
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 3.13.4
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 3.13.4
Piwik\Plugins\CoreAdminHome\Commands\RunScheduledTasks
piwik/piwik 2.18.0
Piwik\Plugins\CoreAdminHome\API
piwik/piwik 2.18.0