Merge branch 'w36_MDL-28701_m22_tempcachedir' of git://github.com/skodak/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 12 Sep 2011 06:26:09 +0000 (18:26 +1200)
committerSam Hemelryk <sam@moodle.com>
Mon, 12 Sep 2011 06:26:09 +0000 (18:26 +1200)
1  2 
files/externallib.php
lib/db/upgrade.php
lib/textlib.class.php
repository/lib.php

@@@ -207,10 -207,10 +207,10 @@@ class moodle_file_external extends exte
              throw new moodle_exception('nofile');
          }
          // saving file
-         $dir = make_upload_directory('temp/wsupload');
+         $dir = make_temp_directory('wsupload');
  
          if (empty($fileinfo['filename'])) {
 -            $filename = uniqid('wsupload').'_'.time().'.tmp';
 +            $filename = uniqid('wsupload', true).'_'.time().'.tmp';
          } else {
              $filename = $fileinfo['filename'];
          }
Simple merge
Simple merge
@@@ -1310,14 -1310,14 +1310,14 @@@ abstract class repository 
       */
      public function prepare_file($filename) {
          global $CFG;
-         if (!file_exists($CFG->dataroot.'/temp/download')) {
-             mkdir($CFG->dataroot.'/temp/download/', $CFG->directorypermissions, true);
+         if (!file_exists($CFG->tempdir.'/download')) {
+             mkdir($CFG->tempdir.'/download/', $CFG->directorypermissions, true);
          }
-         if (is_dir($CFG->dataroot.'/temp/download')) {
-             $dir = $CFG->dataroot.'/temp/download/';
+         if (is_dir($CFG->tempdir.'/download')) {
+             $dir = $CFG->tempdir.'/download/';
          }
          if (empty($filename)) {
 -            $filename = uniqid('repo').'_'.time().'.tmp';
 +            $filename = uniqid('repo', true).'_'.time().'.tmp';
          }
          if (file_exists($dir.$filename)) {
              $filename = uniqid('m').$filename;