Permalink
Browse files

ensuring php5.0 php4.3 compatibility in cron runs

  • Loading branch information...
1 parent c39e721 commit 0a4c172ce79a9c499f6ebe73248930e560c4ac05 diml committed Sep 11, 2007
Showing with 23 additions and 15 deletions.
  1. +1 −15 search/cron.php
  2. +22 −0 search/cron_php5.php
View
16 search/cron.php
@@ -23,20 +23,6 @@
mtrace('Global searching is not enabled. Nothing performed by search.');
}
else{
- try{
- mtrace("<pre>Starting cron...\n");
- mtrace("--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>");
- }
- catch(Exception $ex){
- mtrace('Fatal exception from Lucene subsystem. Search engine may not have been updated.');
- mtrace($ex);
- }
+ include("{$CFG->dirroot}/search/cron_php5.php");
}
?>
View
22 search/cron_php5.php
@@ -0,0 +1,22 @@
+<?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{
+ mtrace("<pre>Starting cron...\n");
+ mtrace("--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>");
+}
+catch(Exception $ex){
+ mtrace('Fatal exception from Lucene subsystem. Search engine may not have been updated.');
+ mtrace($ex);
+}
+?>

0 comments on commit 0a4c172

Please sign in to comment.