index is now MOVED instead of deleted
This commit is contained in:
parent
1f7fcf6f38
commit
879eecabf3
@ -123,14 +123,26 @@
|
|||||||
|
|
||||||
switch ($do) {
|
switch ($do) {
|
||||||
case 'rebuild': {
|
case 'rebuild': {
|
||||||
|
|
||||||
fs_delete_recursive(INDEX_DIR);
|
if (substr(INDEX_DIR, -1) == '/')
|
||||||
if (!file_exists(INDEX_DIR))
|
$oldidx = substr(INDEX_DIR,0,-1);
|
||||||
fs_mkdir(INDEX_DIR);
|
|
||||||
|
$movedir = $oldidx.time();
|
||||||
|
|
||||||
header('Content-Type: text/plain');
|
header('Content-Type: text/plain');
|
||||||
echo "ENTERING LOWRES MODE\n\n";
|
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;
|
new s_entry_crawler;
|
||||||
exit("\nDONE \nPlease, select the back arrow in your browser");
|
exit("\nDONE \nPlease, select the back arrow in your browser");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user