summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-05-13 17:12:55 +0200
committerandi <andi@splitbrain.org>2005-05-13 17:12:55 +0200
commitb000c6d4d26cd8f0e24a02811dac7080f3288cb4 (patch)
tree8d97e2a04eda8185f7b76dd6cd45e766de2b69a5
parentfd198316584f23924cbaf950b2f64028e17e5dbe (diff)
downloadrpg-b000c6d4d26cd8f0e24a02811dac7080f3288cb4.tar.gz
rpg-b000c6d4d26cd8f0e24a02811dac7080f3288cb4.tar.bz2
let scriptify move the old file away after copy
darcs-hash:20050513151255-9977f-ff7a5e5984c8e419654950bfb56b1d42b31937d5.gz
-rw-r--r--inc/init.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/inc/init.php b/inc/init.php
index c6a97e8f9..150e07d83 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -139,6 +139,15 @@ function getBaseURL($abs=false){
return $proto.$host.$port.$dir;
}
+/**
+ * Append a PHP extension to a given file and adds an exit call
+ *
+ * This is used to migrate some old configfiles. An added PHP extension
+ * ensures the contents are not shown to webusers even if .htaccess files
+ * do not work
+ *
+ * @author Jan Decaluwe <jan@jandecaluwe.com>
+ */
function scriptify($file) {
// checks
if (!is_readable($file)) {
@@ -163,8 +172,9 @@ function scriptify($file) {
fwrite($fh, $line);
}
fclose($fh);
+ //try to rename the old file
+ @rename($file,"$file.old");
}
-
//Setup VIM: ex: et ts=2 enc=utf-8 :