ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilBackgroundTaskCronGarbageCollection.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once
"Services/Cron/classes/class.ilCronJob.php"
;
6
12
class
ilBackgroundTaskCronGarbageCollection
extends
ilCronJob
13
{
14
public
function
getId
()
15
{
16
return
"bgtsk_gc"
;
17
}
18
19
public
function
getTitle
()
20
{
21
global
$DIC
;
22
$lng
= $DIC[
'lng'
];
23
24
$lng
->loadLanguageModule(
"bgtask"
);
25
return
$lng
->txt(
"bgtask_cron_gc_title"
);
26
}
27
28
public
function
getDescription
()
29
{
30
global
$DIC
;
31
$lng
= $DIC[
'lng'
];
32
33
$lng
->loadLanguageModule(
"bgtask"
);
34
return
$lng
->txt(
"bgtask_cron_gc_desc"
);
35
}
36
37
public
function
getDefaultScheduleType
()
38
{
39
return
self::SCHEDULE_TYPE_DAILY;
40
}
41
42
public
function
getDefaultScheduleValue
()
43
{
44
return
;
45
}
46
47
public
function
hasAutoActivation
()
48
{
49
return
false
;
50
}
51
52
public
function
hasFlexibleSchedule
()
53
{
54
return
true
;
55
}
56
57
public
function
run
()
58
{
59
global
$DIC
;
60
$ilDB
= $DIC[
'ilDB'
];
61
62
$status =
ilCronJobResult::STATUS_NO_ACTION
;
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)) {
71
$status =
ilCronJobResult::STATUS_OK
;
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
}
83
}
IL_CAL_DATETIME
const IL_CAL_DATETIME
Definition:
class.ilDateTime.php:9
ilBackgroundTaskCronGarbageCollection\getId
getId()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:14
$result
$result
Definition:
CleanUpTest.php:463
ilBackgroundTask\DB_NAME
const DB_NAME
Definition:
class.ilBackgroundTask.php:37
$DIC
global $DIC
Definition:
saml.php:7
ilCronJob
Cron job application base class.
Definition:
class.ilCronJob.php:11
ilBackgroundTaskCronGarbageCollection\getDefaultScheduleValue
getDefaultScheduleValue()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:42
ilBackgroundTaskCronGarbageCollection\getDefaultScheduleType
getDefaultScheduleType()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:37
ilBackgroundTaskCronGarbageCollection\run
run()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:57
IL_CAL_UNIX
const IL_CAL_UNIX
Definition:
class.ilDateTime.php:11
ilBackgroundTaskCronGarbageCollection\hasFlexibleSchedule
hasFlexibleSchedule()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:52
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:32
ilBackgroundTask
Background task.
Definition:
class.ilBackgroundTask.php:11
ilBackgroundTaskCronGarbageCollection\getTitle
getTitle()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:19
ilCronJobResult\STATUS_OK
const STATUS_OK
Definition:
class.ilCronJobResult.php:15
$lng
global $lng
Definition:
privfeed.php:17
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilBackgroundTaskCronGarbageCollection
Background task GC.
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:12
ilCronJobResult
Cron job result data container.
Definition:
class.ilCronJobResult.php:11
$row
$row
Definition:
10autofilter-selection-1.php:74
$handler
$handler
Definition:
resumelogout.php:11
ilBackgroundTaskCronGarbageCollection\getDescription
getDescription()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:28
ilCronJobResult\STATUS_NO_ACTION
const STATUS_NO_ACTION
Definition:
class.ilCronJobResult.php:14
ilBackgroundTaskCronGarbageCollection\hasAutoActivation
hasAutoActivation()
Definition:
class.ilBackgroundTaskCronGarbageCollection.php:47
Services
BackgroundTask
classes
class.ilBackgroundTaskCronGarbageCollection.php
Generated on Sat Jan 18 2025 19:01:27 for ILIAS by
1.8.13 (using
Doxyfile
)