3 * Global Search Engine for Moodle
4 * Michael Champanis (mchampan) [cynnical@gmail.com]
5 * review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
8 * This file serves as a splash-screen (entry page) to the indexer script -
9 * it is in place to prevent accidental reindexing which can lead to a loss
10 * of time, amongst other things.
13 require_once('../config.php');
14 require_once("$CFG->dirroot/search/lib.php");
18 if (empty($CFG->enableglobalsearch
)) {
19 error(get_string('globalsearchdisabled', 'search'));
23 error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php");
26 //check for php5 (lib.php)
27 if (!search_check_php5()) {
28 $phpversion = phpversion();
29 mtrace("Sorry, global search requires PHP 5.0.0 or later (currently using version $phpversion)");
33 require_once("$CFG->dirroot/search/indexlib.php");
34 $indexinfo = new IndexInfo();
36 if ($indexinfo->valid()) {
37 mtrace("<pre>The data directory ($indexinfo->path) contains $indexinfo->filecount files, and\n"
38 ."there are ".$indexinfo->dbcount
." records in the <em>search_documents</em> table.\n"
40 ."This indicates that you have already succesfully indexed this site. Follow the link\n"
41 ."if you are sure that you want to continue indexing - this will replace any existing\n"
42 ."index data (no Moodle data is affected).\n"
44 ."You are encouraged to use the 'Test indexing' script before continuing onto\n"
45 ."indexing - this will check if the modules are set up correctly. Please correct\n"
46 ."any errors before proceeding.\n"
48 ."<a href='tests/index.php'>Test indexing</a> or "
49 ."<a href='indexer.php?areyousure=yes'>Continue indexing</a> or <a href='index.php'>Back to query page</a>."
53 header('Location: indexer.php?areyousure=yes');