if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($pack)) {
set_time_limit(0);
- make_upload_directory('temp');
+ make_temp_directory('');
make_upload_directory('lang');
$installer = new lang_installer($pack);
}
}
- make_upload_directory('temp');
+ make_temp_directory('');
make_upload_directory('lang');
// clean-up currently installed versions of the packs
$params['courseid'] = $course->id;
$params['filetype'] = HUB_BACKUP_FILE_TYPE;
- make_upload_directory('temp/backup');
+ make_temp_directory('backup');
$filename = md5(time() . '-' . $course->id . '-'. $USER->id . '-'. random_string(20));
$form->display();
} else {
$filename = $CFG->tempdir . '/enrolauthorize/importedfile_'.time().'.csv';
- make_upload_directory('temp/enrolauthorize');
+ make_temp_directory('enrolauthorize');
// Fix mac/dos newlines
$text = $form->get_file_content('csvfile');
$text = preg_replace('!\r\n?!', "\n", $text);
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';
// construct directory structure
$this->temp_dir = $CFG->tempdir . "/latex";
- make_upload_directory('temp/latex');
+ make_temp_directory('latex');
}
/**
print_grade_page_head($courseid, 'outcome', 'import', get_string('importoutcomes', 'grades'));
$imported_file = $CFG->tempdir . '/outcomeimport/importedfile_'.time().'.csv';
-make_upload_directory('temp/outcomeimport');
+make_temp_directory('outcomeimport');
// copying imported file
if (!$upload_form->save_file('userfile', $imported_file, true)) {
/// Calculate file name
$downloadfilename = clean_filename("{$this->course->shortname} $strgrades.xml");
- make_upload_directory('temp/gradeexport');
+ make_temp_directory('gradeexport');
$tempfilename = $CFG->tempdir .'/gradeexport/'. md5(sesskey().microtime().$downloadfilename);
if (!$handle = fopen($tempfilename, 'w+b')) {
print_error('cannotcreatetempdir');
// use current (non-conflicting) time stamp
$importcode = get_new_importcode();
- $filename = make_upload_directory('temp/gradeimport/cvs/'.$USER->id);
+ $filename = make_temp_directory('gradeimport/cvs/'.$USER->id);
$filename = $filename.'/'.$importcode;
$text = $mform->get_file_content('userfile');
return COMPONENT_UPTODATE;
}
/// Create temp directory if necesary
- if (!make_upload_directory('temp', false)) {
+ if (!make_temp_directory('', false)) {
$this->errorstring='cannotcreatetempdir';
return COMPONENT_ERROR;
}
function get_new_iid($type) {
global $USER;
- $filename = make_upload_directory('temp/csvimport/'.$type.'/'.$USER->id);
+ $filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id);
// use current (non-conflicting) time stamp
$iiid = time();
$this->latin_output = true;
}
/// Choose our temporary directory - see MDL-7176, found by paulo.matos
- make_upload_directory('temp/excel');
+ make_temp_directory('excel');
$this->pear_excel_workbook->setTempDir($CFG->tempdir.'/excel');
}
if (!$this->get_new_filename($elname)) {
return false;
}
- if (!$dir = make_upload_directory('temp/forms')) {
+ if (!$dir = make_temp_directory('forms')) {
return false;
}
if (!$tempfile = tempnam($dir, 'tempup_')) {
global $CFG;
require_once($CFG->libdir.'/filelib.php');
- $dir = 'temp/ods/'.time();
- make_upload_directory($dir);
- make_upload_directory($dir.'/META-INF');
- $dir = "$CFG->dataroot/$dir";
+ $dir = 'ods/'.time();
+ make_temp_directory($dir);
+ make_temp_directory($dir.'/META-INF');
+ $dir = "$CFG->tempdir/$dir";
$files = array();
$handle = fopen("$dir/mimetype", 'w');
// And this directory must exist to allow Typo to cache conversion
// tables when using internal functions
- make_upload_directory('temp/typo3temp/cs');
+ make_temp_directory('typo3temp/cs');
// Make sure typo is using our dir permissions
$GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'] = decoct($CFG->directorypermissions);
global $CFG, $DB;
$presetname = clean_filename($data->name) . '-preset-' . gmdate("Ymd_Hi");
- $exportsubdir = "temp/mod_data/presetexport/$presetname";
- make_upload_directory($exportsubdir);
+ $exportsubdir = "mod_data/presetexport/$presetname";
+ make_temp_directory($exportsubdir);
$exportdir = "$CFG->dataroot/$exportsubdir";
// Assemble "preset.xml":
$realfilename = $mform->get_new_filename('questionfile');
//TODO: Leave all imported questions in Questionimport for now.
$importfile = "{$CFG->dataroot}/temp/questionimport/{$realfilename}";
- make_upload_directory('temp/questionimport');
+ make_temp_directory('questionimport');
if (!$result = $mform->save_file('questionfile', $importfile, true)) {
throw new moodle_exception('uploadproblem');
}
if (!$debugenablelog || empty($text)) {
return;
}
- if (make_upload_directory('temp/scormlogs/')) {
+ if (make_temp_directory('scormlogs/')) {
$logfile = scorm_debug_log_filename($type, $scoid);
@file_put_contents($logfile, date('Y/m/d H:i:s O')." DEBUG $text\r\n", FILE_APPEND);
}
}
$file = reset($files);
$filename = $CFG->tempdir.'/scormimport/scrom_'.time();
- make_upload_directory('temp/scormimport');
+ make_temp_directory('scormimport');
$file->copy_content_to($filename);
$packer = get_file_packer('application/zip');
global $CFG, $OUTPUT, $USER;
$courseid = $this->course->id;
- $path = 'temp/qformat_qti_two/' . $USER->id . '/' . $this->filename;
+ $path = 'qformat_qti_two/' . $USER->id . '/' . $this->filename;
// create a directory for the exports (if not already existing)
- if (!make_upload_directory($path)) {
+ if (!make_temp_directory($path)) {
throw new moodle_exception('cannotcreatepath', 'question', '', $path);
}
$path = $CFG->dataroot . '/' . $path;
$realfilename = $import_form->get_new_filename('newfile');
$importfile = "{$CFG->dataroot}/temp/questionimport/{$realfilename}";
- make_upload_directory('temp/questionimport');
+ make_temp_directory('questionimport');
if (!$result = $import_form->save_file('newfile', $importfile, true)) {
throw new moodle_exception('uploadproblem');
}