General updates, see README.txt.

This commit is contained in:
mchampan 2006-07-25 17:23:10 +00:00
parent d9e1bf2478
commit b585dc5fcb
12 changed files with 149 additions and 279 deletions

View file

@ -18,30 +18,18 @@
$phpversion = phpversion();
mtrace("Sorry, global search requires PHP 5.0.0 or later (currently using version $phpversion)");
exit(0);
} //if
} //if
$index_path = "$CFG->dataroot/search";
$index_dir = get_directory_list($index_path, '', false, false);
$index_filecount = count($index_dir);
//check if the table exists in the db
$tables = $db->MetaTables();
if (in_array($CFG->prefix.'search_documents', $tables)) {
$db_count = count_records('search_documents');
} else {
$db_count = 0;
} //else
//TODO: elaborate on error messages, when db!=0 and index=0 -> corrupt, etc.
if ($index_filecount != 0 or $db_count != 0) {
mtrace("<pre>The data directory ($index_path) contains $index_filecount files, and\n"
."there are $db_count records in the <em>search_documents</em> table.\n"
require_once("$CFG->dirroot/search/indexlib.php");
$indexinfo = new IndexInfo();
if ($indexinfo->valid()) {
mtrace("<pre>The data directory ($indexinfo->path) contains $indexinfo->filecount files, and\n"
."there are ".$indexinfo->dbcount." records in the <em>search_documents</em> table.\n"
."\n"
."This indicates that you have already succesfully indexed this site, or at least\n"
."started and cancelled an indexing session. Follow the link if you are sure that\n"
."you want to continue indexing - this will replace any existing index data (no\n"
."Moodle data is affected).\n"
."This indicates that you have already succesfully indexed this site. Follow the link\n"
."if you are sure that you want to continue indexing - this will replace any existing\n"
."index data (no Moodle data is affected).\n"
."\n"
."You are encouraged to use the 'Test indexing' script before continuing onto\n"
."indexing - this will check if the modules are set up correctly. Please correct\n"