diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-05 08:44:37 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-05 08:44:37 +0400 |
commit | 3e03b0a7ca4055b4f05be7d4ec7bcfaacf364eff (patch) | |
tree | 47afa18c0b671f38e17405078bdee156ad020058 /plugins/CoreUpdater/Tasks.php | |
parent | 0ed11b178860844b97b967f6cfa1ffd12ab2eaab (diff) |
refs #5301 started to simplify scheduled tasks API while staying backwards compatible
Diffstat (limited to 'plugins/CoreUpdater/Tasks.php')
-rw-r--r-- | plugins/CoreUpdater/Tasks.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/CoreUpdater/Tasks.php b/plugins/CoreUpdater/Tasks.php new file mode 100644 index 0000000000..f8c652781c --- /dev/null +++ b/plugins/CoreUpdater/Tasks.php @@ -0,0 +1,25 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\CoreUpdater; + +class Tasks extends \Piwik\Plugin\Tasks +{ + public function schedule() + { + $this->daily('sendNotificationIfUpdateAvailable', null, self::LOWEST_PRIORITY); + } + + public function sendNotificationIfUpdateAvailable() + { + $coreUpdateCommunication = new UpdateCommunication(); + if ($coreUpdateCommunication->isEnabled()) { + $coreUpdateCommunication->sendNotificationIfUpdateAvailable(); + } + } +}
\ No newline at end of file |