summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/indexer.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index e3af1fd4a..ce58f47a7 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -148,12 +148,16 @@ function idx_addPage($page){
// close the temp file and move it over to be the new one
fclose($tmp);
- if(copy($conf['cachedir'].'/index.tmp',
+ // try rename first (fast) fallback to copy (slow)
+ if(@rename($conf['cachedir'].'/index.tmp',
+ $conf['cachedir'].'/index.idx')){
+ return true;
+ }elseif(copy($conf['cachedir'].'/index.tmp',
$conf['cachedir'].'/index.idx')){
unlink($conf['cachedir'].'/index.tmp');
return true;
}
- else{return false;}
+ return false;
}
/**