3 declare(strict_types=1);
35 $this->
lng = $DIC->language();
36 $this->
lng->loadLanguageModule(
"logging");
43 return "log_error_file_cleanup";
48 return $this->
lng->txt(
"log_error_file_cleanup_title");
53 return $this->
lng->txt(
"log_error_file_cleanup_info");
58 return CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS;
84 $folder = $this->error_settings->folder();
85 if (!is_dir($folder)) {
87 $result->setMessage($this->
lng->txt(
"log_error_path_not_configured_or_wrong"));
91 $offset = $this->
settings->get(
'clear_older_then',
'');
93 $offset = (
int) $offset;
95 $offset = self::DEFAULT_VALUE_OLDER_THAN;
102 foreach ($files as $file) {
103 $file_date = date(
"Y-m-d", filemtime($this->error_settings->folder() .
"/" . $file));
105 if ($file_date <= $delete_date->
get(
IL_CAL_DATE)) {
106 $this->
deleteFile($this->error_settings->folder() .
"/" . $file);
118 $folder = dir($path);
119 while ($file_name = $folder->read()) {
120 if (filetype($path .
"/" . $file_name) !=
"dir") {
136 $offset = $this->
settings->get(
'clear_older_then',
'');
138 $offset = (string) self::DEFAULT_VALUE_OLDER_THAN;
141 $clear_older_then =
new ilNumberInputGUI($this->
lng->txt(
'frm_clear_older_then'),
'clear_older_then');
142 $clear_older_then->allowDecimals(
false);
143 $clear_older_then->setMinValue(1,
true);
144 $clear_older_then->setValue($offset);
145 $clear_older_then->setInfo($this->
lng->txt(
'frm_clear_older_then_info'));
147 $a_form->
addItem($clear_older_then);
152 $threshold = $a_form->
getInput(
'clear_older_then');
153 if ((
string) $threshold ===
'') {
154 $this->
settings->delete(
'clear_older_then');
156 $this->
settings->set(
'clear_older_then', (
string) ((
int) $a_form->
getInput(
'clear_older_then')));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLoggingErrorSettings $error_settings
saveCustomSettings(ilPropertyFormGUI $a_form)
const DEFAULT_VALUE_OLDER_THAN
getDefaultScheduleValue()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...