Merged changes in main trunk up to 2.0.6 (see CHANGELOG)
[fa-stable.git] / admin / db / maintenance_db.inc
index ff7db9ca9c7ec5e5b56033551626ebc671dc8269..1d9a027380273950d44cb58f32aa6ba175f6c2fe 100644 (file)
@@ -642,5 +642,21 @@ function save_to_file($backupfile, $zip, $fileData)
     }
 }
 
-
+function create_comp_dirs($comp_path, $comp_subdirs)
+{
+               $index = "<?php\nheader(\"Location: ../index.php\");\n?>";
+           $cdir = $comp_path;
+           @mkdir($cdir);
+               $f = @fopen("$cdir/index.php", "wb");
+               @fwrite($f, $index);
+               @fclose($f);
+
+           foreach($comp_subdirs as $dir)
+           {
+                       @mkdir($cdir.'/'.$dir);
+                       $f = @fopen("$cdir/$dir/index.php", "wb");
+                       @fwrite($f, $index);
+                       @fclose($f);
+           }
+}
 ?>
\ No newline at end of file