Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| SessionDeleteByCron | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||
| init | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsbackend\Helper; |
| 4 | |
| 5 | /** |
| 6 | * @codeCoverageIgnore |
| 7 | */ |
| 8 | class SessionDeleteByCron |
| 9 | { |
| 10 | /** |
| 11 | * Delete sessiondata older than SESSION_DURATION. |
| 12 | * When $sessionName is null/empty, all session names are cleaned. |
| 13 | */ |
| 14 | public static function init(?string $sessionName = null, ?int $deleteInSeconds = null): void |
| 15 | { |
| 16 | $deleteInSeconds = $deleteInSeconds ?? (int) \App::SESSION_DURATION; |
| 17 | $query = new \BO\Zmsbackend\Session\Service\Session(); |
| 18 | $query->deleteByTimeInterval($sessionName, $deleteInSeconds); |
| 19 | } |
| 20 | } |