Commit ea7d7b35 authored by Penny Leach's avatar Penny Leach
Browse files

Cherry picking a cherry picked commit... unziptempdir

very manual cherry of f5c4ed7b

reworked to live in new import/file plugin
parent 8b6dfe7c
......@@ -272,13 +272,18 @@ class MnetImporterTransport extends ImporterTransport {
}
$this->relativepath = 'temp/import/' . $this->importer->get('id') . '/';
$this->tempdir = get_config('dataroot') . $this->relativepath;
if ($tmpdir = get_config('unziptempdir')) {
$this->tempdir = $tmpdir . $this->relativepath;
}
else {
$this->tempdir = get_config('dataroot') . $this->relativepath;
}
if (!check_dir_exists($this->tempdir)) {
throw new ImportException('Failed to create the temporary directories to work in');
}
$this->zipfilename = 'import.zip';
if (!file_put_contents($this->tempdir . '/' . $this->zipfilename, $filecontents)) {
if (!file_put_contents($this->tempdir . $this->zipfilename, $filecontents)) {
throw new ImportException('Failed to write out the zipfile to local temporary storage');
}
}
......@@ -286,6 +291,7 @@ class MnetImporterTransport extends ImporterTransport {
public function files_info() {
return array(
'zipfile' => $this->zipfilename,
'tempdir' => $this->tempdir,
'relativepath' => $this->relativepath,
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment