3 declare(strict_types=1);
33 $this->
lng = $DIC->language();
34 $this->
lng->loadLanguageModule(
"logging");
41 return "log_error_file_cleanup";
46 return $this->
lng->txt(
"log_error_file_cleanup_title");
51 return $this->
lng->txt(
"log_error_file_cleanup_info");
56 return self::SCHEDULE_TYPE_IN_DAYS;
82 $folder = $this->error_settings->folder();
83 if (!is_dir($folder)) {
85 $result->setMessage($this->
lng->txt(
"log_error_path_not_configured_or_wrong"));
89 $offset = $this->
settings->get(
'clear_older_then',
'');
91 $offset = (
int) $offset;
93 $offset = self::DEFAULT_VALUE_OLDER_THAN;
100 foreach ($files as $file) {
101 $file_date = date(
"Y-m-d", filemtime($this->error_settings->folder() .
"/" . $file));
103 if ($file_date <= $delete_date->
get(
IL_CAL_DATE)) {
104 $this->
deleteFile($this->error_settings->folder() .
"/" . $file);
116 $folder = dir($path);
117 while ($file_name = $folder->read()) {
118 if (filetype($path .
"/" . $file_name) !=
"dir") {
134 $offset = $this->
settings->get(
'clear_older_then',
'');
136 $offset = (string) self::DEFAULT_VALUE_OLDER_THAN;
139 $clear_older_then =
new ilNumberInputGUI($this->
lng->txt(
'frm_clear_older_then'),
'clear_older_then');
141 $clear_older_then->setMinValue(1,
true);
142 $clear_older_then->setValue($offset);
143 $clear_older_then->setInfo($this->
lng->txt(
'frm_clear_older_then_info'));
145 $a_form->
addItem($clear_older_then);
150 $threshold = $a_form->
getInput(
'clear_older_then');
151 if ((
string) $threshold ===
'') {
152 $this->
settings->delete(
'clear_older_then');
154 $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)
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...