-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfetch_updates.cronjob.php
executable file
·54 lines (50 loc) · 1.87 KB
/
fetch_updates.cronjob.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
class FetchUpdatesJob extends CronJob
{
/**
* Returns the name of the cronjob.
*/
public static function getName()
{
return _('CampusConnect Downloads');
}
/**
* Returns the description of the cronjob.
*/
public static function getDescription()
{
return _('Holt Daten vom ECS ab und pflegt sie in Stud.IP ein.');
}
public function setUp() {
require_once __DIR__.'/lib/CCParticipant.php';
require_once __DIR__.'/lib/CampusConnectLog.php';
require_once __DIR__.'/lib/CampusConnectHelper.php';
require_once __DIR__.'/lib/EcsClient.php';
require_once __DIR__.'/lib/EcsResult.php';
require_once __DIR__.'/lib/CampusConnectClient.php';
require_once __DIR__.'/lib/CampusConnectTriggerStack.php';
require_once __DIR__.'/lib/CampusConnectEntity.php';
require_once __DIR__.'/lib/CampusConnectSentItem.php';
require_once __DIR__.'/lib/CCCourse.php';
require_once __DIR__.'/lib/CCRessources.php';
require_once __DIR__.'/lib/CampusConnector.php';
if (Config::get()->CAMPUSCONNECT_LOGFILE) {
CampusConnectLog::get()->setHandler($GLOBALS['TMP_PATH']."/".Config::get()->CAMPUSCONNECT_LOGFILE);
}
}
/**
* Executes the cronjob.
*
* @param mixed $last_result What the last execution of this cronjob
* returned.
* @param Array $parameters Parameters for this cronjob instance which
* were defined during scheduling.
* Only valid parameter at the moment is
* "verbose" which toggles verbose output while
* purging the cache.
*/
public function execute($last_result, $parameters = array())
{
CampusConnector::fetch_updates();
}
}