forked from tmuras/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcron_php5.php
33 lines (30 loc) · 985 Bytes
/
cron_php5.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
<?php
/*
* Moodle global search engine
* This is a special externalized code for cron handling in PHP5.
* Should never be called by a php 4.3.0 implementation.
*/
try{
// overrides php limits
$maxtimelimit = ini_get('max_execution_time');
ini_set('max_execution_time', 300);
$maxmemoryamount = ini_get('memory_limit');
ini_set('memory_limit', '48M');
mtrace("\n--DELETE----");
require_once("$CFG->dirroot/search/delete.php");
mtrace("--UPDATE----");
require_once("$CFG->dirroot/search/update.php");
mtrace("--ADD-------");
require_once("$CFG->dirroot/search/add.php");
mtrace("------------");
//mtrace("cron finished.</pre>");
mtrace('done');
// set back normal values for php limits
ini_set('max_execution_time', $maxtimelimit);
ini_set('memory_limit', $maxmemoryamount);
}
catch(Exception $ex){
mtrace('Fatal exception from Lucene subsystem. Search engine may not have been updated.');
mtrace($ex);
}
?>