ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBackgroundTaskCronGarbageCollection Class Reference

Background task GC. More...

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

Public Member Functions

 getId ()
 Get id. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 run ()
 Run job. More...
 
- 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...
 
 getValidScheduleTypes ()
 Get all available schedule types. 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 ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

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

38 {
40 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilBackgroundTaskCronGarbageCollection::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

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

43 {
44 return;
45 }

◆ getDescription()

ilBackgroundTaskCronGarbageCollection::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

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

References $DIC, and $lng.

◆ getId()

ilBackgroundTaskCronGarbageCollection::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

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

15 {
16 return "bgtsk_gc";
17 }

◆ getTitle()

ilBackgroundTaskCronGarbageCollection::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

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

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

References $DIC, and $lng.

◆ hasAutoActivation()

ilBackgroundTaskCronGarbageCollection::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

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

48 {
49 return false;
50 }

◆ hasFlexibleSchedule()

ilBackgroundTaskCronGarbageCollection::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

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

53 {
54 return true;
55 }

◆ run()

ilBackgroundTaskCronGarbageCollection::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

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

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
79 $result->setStatus($status);
80
81 return $result;
82 }
$result
const IL_CAL_UNIX
const IL_CAL_DATETIME
Cron job result data container.
@classDescription Date and time handling
$handler
global $ilDB

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


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