ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBackgroundTaskCronGarbageCollection Class Reference

Background task GC. More...

+ Inheritance diagram for ilBackgroundTaskCronGarbageCollection:
+ Collaboration diagram for ilBackgroundTaskCronGarbageCollection:

Public Member Functions

 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 run ()
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

Background task GC.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 12 of file class.ilBackgroundTaskCronGarbageCollection.php.

Member Function Documentation

◆ getDefaultScheduleType()

ilBackgroundTaskCronGarbageCollection::getDefaultScheduleType ( )

Definition at line 37 of file class.ilBackgroundTaskCronGarbageCollection.php.

38  {
39  return self::SCHEDULE_TYPE_DAILY;
40  }

◆ getDefaultScheduleValue()

ilBackgroundTaskCronGarbageCollection::getDefaultScheduleValue ( )

Definition at line 42 of file class.ilBackgroundTaskCronGarbageCollection.php.

43  {
44  return;
45  }

◆ getDescription()

ilBackgroundTaskCronGarbageCollection::getDescription ( )

Definition at line 28 of file class.ilBackgroundTaskCronGarbageCollection.php.

References $DIC, and $lng.

29  {
30  global $DIC;
31  $lng = $DIC['lng'];
32 
33  $lng->loadLanguageModule("bgtask");
34  return $lng->txt("bgtask_cron_gc_desc");
35  }
global $DIC
Definition: saml.php:7
$lng

◆ getId()

ilBackgroundTaskCronGarbageCollection::getId ( )

Definition at line 14 of file class.ilBackgroundTaskCronGarbageCollection.php.

15  {
16  return "bgtsk_gc";
17  }

◆ getTitle()

ilBackgroundTaskCronGarbageCollection::getTitle ( )

Definition at line 19 of file class.ilBackgroundTaskCronGarbageCollection.php.

References $DIC, and $lng.

20  {
21  global $DIC;
22  $lng = $DIC['lng'];
23 
24  $lng->loadLanguageModule("bgtask");
25  return $lng->txt("bgtask_cron_gc_title");
26  }
global $DIC
Definition: saml.php:7
$lng

◆ hasAutoActivation()

ilBackgroundTaskCronGarbageCollection::hasAutoActivation ( )

Definition at line 47 of file class.ilBackgroundTaskCronGarbageCollection.php.

48  {
49  return false;
50  }

◆ hasFlexibleSchedule()

ilBackgroundTaskCronGarbageCollection::hasFlexibleSchedule ( )

Definition at line 52 of file class.ilBackgroundTaskCronGarbageCollection.php.

53  {
54  return true;
55  }

◆ run()

ilBackgroundTaskCronGarbageCollection::run ( )

Definition at line 57 of file class.ilBackgroundTaskCronGarbageCollection.php.

References $DIC, $handler, $ilDB, $result, $row, ilBackgroundTask\DB_NAME, IL_CAL_DATETIME, IL_CAL_UNIX, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

58  {
59  global $DIC;
60  $ilDB = $DIC['ilDB'];
61 
63 
64  $cut = new ilDateTime(strtotime("-1day"), IL_CAL_UNIX);
65 
66  include_once "Services/BackgroundTask/classes/class.ilBackgroundTask.php";
67 
68  $set = $ilDB->query("SELECT id FROM " . ilBackgroundTask::DB_NAME .
69  " WHERE start_date <= " . $ilDB->quote($cut->get(IL_CAL_DATETIME), "text"));
70  while ($row = $ilDB->fetchAssoc($set)) {
72 
73  $task = new ilBackgroundTask($row["id"]);
74  $handler = $task->getHandlerInstance();
75  $handler->deleteTaskAndFiles();
76  }
77 
78  $result = new ilCronJobResult();
79  $result->setStatus($status);
80 
81  return $result;
82  }
const IL_CAL_DATETIME
$result
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
Date and time handling
$row
global $ilDB
Cron job result data container.
$handler

The documentation for this class was generated from the following file: