Daily.php
1 month ago
Hourly.php
2 years ago
Monthly.php
2 years ago
Schedule.php
1 year ago
SpecificTime.php
2 years ago
Weekly.php
1 year ago
Daily.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\Scheduler\Schedule; |
| 10 | |
| 11 | use Exception; |
| 12 | /** |
| 13 | * Daily class is used to schedule tasks every day. |
| 14 | * |
| 15 | * @see \Piwik\Scheduler\Task |
| 16 | */ |
| 17 | class Daily extends \Piwik\Scheduler\Schedule\Schedule |
| 18 | { |
| 19 | /** |
| 20 | * @see ScheduledTime::getRescheduledTime |
| 21 | * @return int |
| 22 | */ |
| 23 | public function getRescheduledTime() |
| 24 | { |
| 25 | $currentTime = $this->getTime(); |
| 26 | // Add one day |
| 27 | $rescheduledTime = mktime(date('H', $currentTime), date('i', $currentTime), date('s', $currentTime), date('n', $currentTime), date('j', $currentTime) + 1, date('Y', $currentTime)); |
| 28 | // Adjusts the scheduled hour |
| 29 | $rescheduledTime = $this->adjustHour($rescheduledTime); |
| 30 | $rescheduledTime = $this->adjustTimezone($rescheduledTime); |
| 31 | return $rescheduledTime; |
| 32 | } |
| 33 | /** |
| 34 | * @see ScheduledTime::setDay |
| 35 | * @param int $_day |
| 36 | * @throws \Exception |
| 37 | * @ignore |
| 38 | */ |
| 39 | public function setDay($_day) |
| 40 | { |
| 41 | throw new Exception("Method not supported"); |
| 42 | } |
| 43 | } |
| 44 |