]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7829 zipping with binary zip broken under windows when moodledata on different...
authorskodak <skodak>
Fri, 29 Dec 2006 22:52:01 +0000 (22:52 +0000)
committerskodak <skodak>
Fri, 29 Dec 2006 22:52:01 +0000 (22:52 +0000)
lib/moodlelib.php

index 2c06dcc38221ae7a3cf7794f19e612570efb2cd5..7b9825684ca2ecf45aea498f798dfc8b077de996 100644 (file)
@@ -6075,8 +6075,14 @@ function zip_files ($originalfiles, $destination) {
             $filestozip .= " ";
         }
         //Construct the command
-        $separator = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? ' &' : ' ;';
-        $command = 'cd '.escapeshellarg($origpath).$separator.
+        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+            $separator = ' &';
+            $command= substr($CFG->dataroot, 0, 2).$separator; // change to drive with moodledata
+        } else {
+            $separator = ' ;';
+            $command= '';
+        }
+        $command .= 'cd '.escapeshellarg($origpath).$separator.
                     escapeshellarg($CFG->zip).' -r '.
                     escapeshellarg(cleardoubleslashes("$destpath/$destfilename")).' '.$filestozip;
         //All converted to backslashes in WIN