ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilAuthDestroyExpiredSessionsCron.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected ilLanguage $lng;
24 
25  public function __construct()
26  {
27  global $DIC;
28 
29  $this->lng = $DIC->language();
30  $this->lng->loadLanguageModule('auth');
31  }
32 
33  public function getId(): string
34  {
35  return 'auth_destroy_expired_sessions';
36  }
37 
38  public function getTitle(): string
39  {
40  return $this->lng->txt('auth_cron_destroy_expired_sessions');
41  }
42 
43  public function getDescription(): string
44  {
45  return $this->lng->txt('auth_cron_destroy_expired_sessions_desc');
46  }
47 
48  public function hasAutoActivation(): bool
49  {
50  return false;
51  }
52 
53  public function hasFlexibleSchedule(): bool
54  {
55  return true;
56  }
57 
58  public function getDefaultScheduleType(): ILIAS\Cron\Schedule\CronJobScheduleType
59  {
60  return ILIAS\Cron\Schedule\CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES;
61  }
62 
63  public function getDefaultScheduleValue(): ?int
64  {
65  return 1;
66  }
67 
68  public function isManuallyExecutable(): bool
69  {
70  return false;
71  }
72 
73  public function run(): ilCronJobResult
74  {
75  $result = new ilCronJobResult();
76  $result->setStatus(ilCronJobResult::STATUS_OK);
77 
78  $num_destroyed_sessions = ilSession::_destroyExpiredSessions();
80  $result->setMessage('Number of destroyed sessions: ' . $num_destroyed_sessions);
81 
82  return $result;
83  }
84 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
static _destroyExpiredSessions()
Destroy expired sessions.
static aggretateRaw(int $a_now)
Aggregate raw session data (older than given time)
global $DIC
Definition: feed.php:28