3 require_once(
"Services/Cron/classes/class.ilCronJob.php");
4 require_once(
"Services/Logging/classes/error/class.ilLoggingErrorSettings.php");
5 require_once(
"Services/Administration/classes/class.ilSetting.php");
6 require_once(
"Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
7 require_once(
"Services/Form/classes/class.ilTextInputGUI.php");
8 require_once(
"Services/Calendar/classes/class.ilDateTime.php");
9 require_once(
"Services/Cron/classes/class.ilCronJobResult.php");
10 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
24 $this->lng->loadLanguageModule(
"logging");
34 return "log_error_file_cleanup";
42 return $this->lng->txt(
"log_error_file_cleanup_title");
50 return $this->lng->txt(
"log_error_file_cleanup_info");
58 return self::SCHEDULE_TYPE_IN_DAYS;
99 $folder = $this->error_settings->folder();
100 if (!is_dir($folder)) {
102 $result->setMessage($this->lng->txt(
"log_error_path_not_configured_or_wrong"));
106 $offset = $this->
settings->get(
'clear_older_then');
108 $offset = self::DEFAULT_VALUE_OLDER_THAN;
115 foreach (
$files as $file) {
116 $file_date = date(
"Y-m-d", filemtime($this->error_settings->folder() .
"/" . $file));
118 if ($file_date <= $delete_date->
get(
IL_CAL_DATE)) {
119 $this->
deleteFile($this->error_settings->folder() .
"/" . $file);
131 $folder = dir(
$path);
132 while ($file_name = $folder->read()) {
133 if (filetype(
$path .
"/" . $file_name) !=
"dir") {
152 $offset = $this->
settings->get(
'clear_older_then');
154 $offset = self::DEFAULT_VALUE_OLDER_THAN;
156 $clear_older_then =
new ilNumberInputGUI($this->lng->txt(
'frm_clear_older_then'),
'clear_older_then');
158 $clear_older_then->setMinValue(1,
true);
159 $clear_older_then->setValue($offset);
160 $clear_older_then->setInfo($this->lng->txt(
'frm_clear_older_then_info'));
162 $a_form->
addItem($clear_older_then);
171 $this->
settings->set(
'clear_older_then', $a_form->
getInput(
'clear_older_then'));
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
Cron job application base class.
saveCustomSettings(ilPropertyFormGUI $a_form)
const DEFAULT_VALUE_OLDER_THAN
getDefaultScheduleValue()
Cron job result data container.