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
Hourly.php
51 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 | * Hourly class is used to schedule tasks every hour. |
| 14 | * |
| 15 | * @see \Piwik\Scheduler\Task |
| 16 | */ |
| 17 | class Hourly 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 | // Adds one hour and reset the number of minutes |
| 27 | $rescheduledTime = mktime(date('H', $currentTime) + 1, 0, date('s', $currentTime), date('n', $currentTime), date('j', $currentTime), date('Y', $currentTime)); |
| 28 | return $rescheduledTime; |
| 29 | } |
| 30 | /** |
| 31 | * @see ScheduledTime::setHour |
| 32 | * @param int $_hour |
| 33 | * @throws \Exception |
| 34 | * @return int |
| 35 | */ |
| 36 | public function setHour($_hour) |
| 37 | { |
| 38 | throw new Exception("Method not supported"); |
| 39 | } |
| 40 | /** |
| 41 | * @see ScheduledTime::setDay |
| 42 | * @param int $_day |
| 43 | * @throws \Exception |
| 44 | * @return int |
| 45 | */ |
| 46 | public function setDay($_day) |
| 47 | { |
| 48 | throw new Exception("Method not supported"); |
| 49 | } |
| 50 | } |
| 51 |