diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-11-11 13:10:40 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-11-11 13:10:40 +0400 |
commit | e0e83ef063827840e876642088e01e0e583f2adf (patch) | |
tree | b8d45e16f2cb8345eea718c15494762deaddb007 /plugins | |
parent | 8cc4127127f2a8f9e95642470cac2e870e1f0d1a (diff) |
Simplifying API for creating scheduled tasks, ScheduledTime objects now created via factory eg. ScheduledTime::factory('daily');
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreAdminHome/CoreAdminHome.php | 5 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/CorePluginsAdmin.php | 3 | ||||
-rw-r--r-- | plugins/DBStats/DBStats.php | 3 | ||||
-rw-r--r-- | plugins/PrivacyManager/PrivacyManager.php | 5 |
4 files changed, 10 insertions, 6 deletions
diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index 280229238e..b26fe660ba 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -18,6 +18,7 @@ use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\ScheduledTask; use Piwik\ScheduledTime\Daily; +use Piwik\ScheduledTime; use Piwik\Settings\Manager as SettingsManager; use Piwik\Settings\UserSetting; @@ -52,7 +53,7 @@ class CoreAdminHome extends \Piwik\Plugin $purgeArchiveTablesTask = new ScheduledTask ($this, 'purgeOutdatedArchives', null, - new Daily(), + ScheduledTime::factory('daily'), ScheduledTask::HIGH_PRIORITY); $tasks[] = $purgeArchiveTablesTask; @@ -60,7 +61,7 @@ class CoreAdminHome extends \Piwik\Plugin $optimizeArchiveTableTask = new ScheduledTask ($this, 'optimizeArchiveTable', null, - new Daily(), + ScheduledTime::factory('daily'), ScheduledTask::LOWEST_PRIORITY); $tasks[] = $optimizeArchiveTableTask; } diff --git a/plugins/CorePluginsAdmin/CorePluginsAdmin.php b/plugins/CorePluginsAdmin/CorePluginsAdmin.php index e97ce1761f..03a62a6753 100644 --- a/plugins/CorePluginsAdmin/CorePluginsAdmin.php +++ b/plugins/CorePluginsAdmin/CorePluginsAdmin.php @@ -15,6 +15,7 @@ use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\ScheduledTask; use Piwik\ScheduledTime\Daily; +use Piwik\ScheduledTime; /** * @@ -45,7 +46,7 @@ class CorePluginsAdmin extends \Piwik\Plugin 'Piwik\Plugins\CorePluginsAdmin\MarketplaceApiClient', 'clearAllCacheEntries', null, - new Daily(), + ScheduledTime::factory('daily'), ScheduledTask::LOWEST_PRIORITY ); } diff --git a/plugins/DBStats/DBStats.php b/plugins/DBStats/DBStats.php index f32d07bce6..d82fd8e728 100644 --- a/plugins/DBStats/DBStats.php +++ b/plugins/DBStats/DBStats.php @@ -20,6 +20,7 @@ use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable; use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Pie; use Piwik\ScheduledTask; use Piwik\ScheduledTime\Weekly; +use Piwik\ScheduledTime; /** * @@ -60,7 +61,7 @@ class DBStats extends \Piwik\Plugin $this, 'cacheDataByArchiveNameReports', null, - new Weekly(), + ScheduledTime::factory('weekly'), ScheduledTask::LOWEST_PRIORITY ); $tasks[] = $cacheDataByArchiveNameReportsTask; diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index 8bb2040870..7685d3a460 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -26,6 +26,7 @@ use Piwik\Piwik; use Piwik\Plugins\Goals\Archiver; use Piwik\ScheduledTask; use Piwik\ScheduledTime\Daily; +use Piwik\ScheduledTime; use Piwik\Site; use Piwik\Tracker\GoalManager; @@ -141,12 +142,12 @@ class PrivacyManager extends \Piwik\Plugin // they will execute before the optimize tables task $purgeReportDataTask = new ScheduledTask( - $this, 'deleteReportData', null, new Daily(), ScheduledTask::LOW_PRIORITY + $this, 'deleteReportData', null, ScheduledTime::factory('daily'), ScheduledTask::LOW_PRIORITY ); $tasks[] = $purgeReportDataTask; $purgeLogDataTask = new ScheduledTask( - $this, 'deleteLogData', null, new Daily(), ScheduledTask::LOW_PRIORITY + $this, 'deleteLogData', null, ScheduledTime::factory('daily'), ScheduledTask::LOW_PRIORITY ); $tasks[] = $purgeLogDataTask; } |