2007-09-11 08:03:40 +00:00
|
|
|
<?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.
|
2009-03-23 21:07:02 +00:00
|
|
|
* @package search
|
|
|
|
* @category core
|
|
|
|
* @subpackage search_engine
|
|
|
|
* @author Michael Champanis (mchampan) [cynnical@gmail.com], Valery Fremaux [valery.fremaux@club-internet.fr] > 1.8
|
|
|
|
* @date 2008/03/31
|
|
|
|
* @version prepared for 2.0
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
2007-09-11 08:03:40 +00:00
|
|
|
*/
|
2008-03-31 22:21:42 +00:00
|
|
|
|
2007-09-11 08:03:40 +00:00
|
|
|
try{
|
2009-03-26 02:09:28 +00:00
|
|
|
ini_set('max_execution_time', 300);
|
2009-03-30 10:07:24 +00:00
|
|
|
if (empty($CFG->extramemorylimit)) {
|
2009-03-26 02:09:28 +00:00
|
|
|
raise_memory_limit('128M');
|
|
|
|
} else {
|
2009-03-30 10:07:24 +00:00
|
|
|
raise_memory_limit($CFG->extramemorylimit);
|
2009-03-26 02:09:28 +00:00
|
|
|
}
|
2007-10-07 20:14:17 +00:00
|
|
|
|
2007-11-20 04:12:18 +00:00
|
|
|
mtrace("\n--DELETE----");
|
2009-03-23 21:07:02 +00:00
|
|
|
require_once($CFG->dirroot.'/search/delete.php');
|
2007-09-11 08:03:40 +00:00
|
|
|
mtrace("--UPDATE----");
|
2009-03-23 21:07:02 +00:00
|
|
|
require_once($CFG->dirroot.'/search/update.php');
|
2007-09-11 08:03:40 +00:00
|
|
|
mtrace("--ADD-------");
|
2009-03-23 21:07:02 +00:00
|
|
|
require_once($CFG->dirroot.'/search/add.php');
|
2007-09-11 08:03:40 +00:00
|
|
|
mtrace("------------");
|
2007-11-20 04:12:18 +00:00
|
|
|
//mtrace("cron finished.</pre>");
|
|
|
|
mtrace('done');
|
2007-09-11 08:03:40 +00:00
|
|
|
}
|
|
|
|
catch(Exception $ex){
|
|
|
|
mtrace('Fatal exception from Lucene subsystem. Search engine may not have been updated.');
|
|
|
|
mtrace($ex);
|
|
|
|
}
|
2009-03-26 02:09:28 +00:00
|
|
|
?>
|