index is now MOVED instead of deleted

This commit is contained in:
real_nowhereman 2009-11-21 15:03:10 +00:00
parent 1f7fcf6f38
commit 879eecabf3

View File

@ -123,14 +123,26 @@
switch ($do) {
case 'rebuild': {
fs_delete_recursive(INDEX_DIR);
if (!file_exists(INDEX_DIR))
fs_mkdir(INDEX_DIR);
if (substr(INDEX_DIR, -1) == '/')
$oldidx = substr(INDEX_DIR,0,-1);
$movedir = $oldidx.time();
header('Content-Type: text/plain');
echo "ENTERING LOWRES MODE\n\n";
if (file_exists(INDEX_DIR)) {
echo "BACKUP INDEX to $movedir\n";
$ret = @rename($oldidx, $movedir);
if (!$ret) trigger_error('Cannot backup old index. STOP.', E_USER_ERROR);
}
fs_mkdir(INDEX_DIR);
new s_entry_crawler;
exit("\nDONE \nPlease, select the back arrow in your browser");