diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-05-07 12:13:33 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-05-07 12:13:33 +0200 |
commit | 3aee4c27813a30e720d3ad1fbcbd2e372a88573a (patch) | |
tree | 133a229e3ab17cb7249bdcb30a76c12ec0349985 | |
parent | 15c394af375029974595fcd96feeadcb4e7005b8 (diff) | |
download | rpg-3aee4c27813a30e720d3ad1fbcbd2e372a88573a.tar.gz rpg-3aee4c27813a30e720d3ad1fbcbd2e372a88573a.tar.bz2 |
changed all occurances of rename() to io_rename()
darcs-hash:20060507101333-7ad00-e687d797fbee26e0b0bc7741ff8a1af496c101bf.gz
-rw-r--r-- | inc/indexer.php | 10 | ||||
-rw-r--r-- | inc/init.php | 2 | ||||
-rw-r--r-- | lib/plugins/config/settings/config.class.php | 4 |
3 files changed, 5 insertions, 11 deletions
diff --git a/inc/indexer.php b/inc/indexer.php index fa3803665..789a98d91 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -164,14 +164,8 @@ function idx_addPage($page){ // close the temp file and move it over to be the new one fclose($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; - } + io_rename($conf['cachedir'].'/index.tmp', + $conf['cachedir'].'/index.idx'); return false; } diff --git a/inc/init.php b/inc/init.php index ab986b0d2..00d6a6a90 100644 --- a/inc/init.php +++ b/inc/init.php @@ -313,7 +313,7 @@ function scriptify($file) { } fclose($fh); //try to rename the old file - @rename($file,"$file.old"); + io_rename($file,"$file.old"); } /** diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 0b93b882d..e51f65814 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -89,11 +89,11 @@ if (!class_exists('configuration')) { // backup current file (remove any existing backup) if (@file_exists($file) && $backup) { if (@file_exists($file.'.bak')) @unlink($file.'.bak'); - if (!@rename($file, $file.'.bak')) return false; + if (!io_rename($file, $file.'.bak')) return false; } if (!$fh = @fopen($file, 'wb')) { - @rename($file.'.bak', $file); // problem opening, restore the backup + io_rename($file.'.bak', $file); // problem opening, restore the backup return false; } |