ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilAuthDestroyExpiredSessionsCron.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
23 
25 {
26  protected ilLanguage $lng;
27 
28  public function __construct()
29  {
30  global $DIC;
31 
32  $this->lng = $DIC->language();
33  $this->lng->loadLanguageModule('auth');
34  }
35 
36  public function getId(): string
37  {
38  return 'auth_destroy_expired_sessions';
39  }
40 
41  public function getTitle(): string
42  {
43  return $this->lng->txt('auth_cron_destroy_expired_sessions');
44  }
45 
46  public function getDescription(): string
47  {
48  return $this->lng->txt('auth_cron_destroy_expired_sessions_desc');
49  }
50 
51  public function hasAutoActivation(): bool
52  {
53  return true;
54  }
55 
56  public function hasFlexibleSchedule(): bool
57  {
58  return true;
59  }
60 
61  public function getDefaultScheduleType(): \ILIAS\Cron\Job\Schedule\JobScheduleType
62  {
63  return \ILIAS\Cron\Job\Schedule\JobScheduleType::IN_HOURS;
64  }
65 
66  public function getDefaultScheduleValue(): ?int
67  {
68  return 1;
69  }
70 
71  public function isManuallyExecutable(): bool
72  {
73  return false;
74  }
75 
76  public function run(): JobResult
77  {
78  $result = new JobResult();
79  $result->setStatus(JobResult::STATUS_OK);
80 
81  $num_destroyed_sessions = ilSession::_destroyExpiredSessions();
83  $result->setMessage('Number of destroyed sessions: ' . $num_destroyed_sessions);
84 
85  return $result;
86  }
87 }
Interface Observer Contains several chained tasks and infos about them.
static _destroyExpiredSessions()
Destroy expired sessions.
static aggretateRaw(int $a_now)
Aggregate raw session data (older than given time)
global $DIC
Definition: shib_login.php:22