4 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
5 include_once
'./Services/Export/classes/class.ilExport.php';
30 parent::__construct();
47 $sub_dir = $ts.
"__".IL_INST_ID.
"__".$a_type.
"_".$a_id;
49 $this->cont_export_dir = $export_dir.DIRECTORY_SEPARATOR.$sub_dir;
52 $GLOBALS[
'ilLog']->write(__METHOD__.
' using base directory: '.$this->export_run_dir);
56 $this->
addSubitems($a_id,$a_type,$a_target_release);
59 ilUtil::zip($this->cont_export_dir, $this->cont_export_dir.
'.zip');
69 $GLOBALS[
'ilLog']->write(__METHOD__.
': wrinting manifest');
70 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
72 $this->cont_manifest_writer->xmlHeader();
73 $this->cont_manifest_writer->xmlStartTag(
76 "MainEntity" => $a_type,
78 "TargetRelease" => $a_target_release,
79 "InstallationId" => IL_INST_ID,
80 "InstallationUrl" => ILIAS_HTTP_PATH)
102 $GLOBALS[
'ilLog']->write(__METHOD__);
104 foreach($this->eo->getSubitemsForExport() as
$ref_id)
118 $exp_full = $exp_dir.DIRECTORY_SEPARATOR.$expi->getFilename();
120 $GLOBALS[
'ilLog']->write(__METHOD__.
': zip path '.$exp_full);
129 $new_path_rel =
'set_'.$set_number.DIRECTORY_SEPARATOR.$expi->getBasename();
130 $new_path_abs = $this->cont_export_dir.DIRECTORY_SEPARATOR.$new_path_rel;
132 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.$new_path_rel.
' '.$new_path_abs);
136 $exp_dir.DIRECTORY_SEPARATOR.$expi->getBasename(),
140 $GLOBALS[
'ilLog']->write($exp_dir.DIRECTORY_SEPARATOR.$expi->getBasename().
' -> '.$new_path_abs);
146 if(file_exists($exp_full))
148 $GLOBALS[
'ilLog']->write(__METHOD__.
': Deleting'. $exp_full);
153 $this->cont_manifest_writer->xmlElement(
156 'Path' => $new_path_rel,
175 $this->cont_manifest_writer->xmlEndTag(
'Manifest');
176 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.$this->cont_export_dir.DIRECTORY_SEPARATOR.
'manifest.xml');
177 $this->cont_manifest_writer->xmlDumpFile($this->cont_export_dir.DIRECTORY_SEPARATOR.
'manifest.xml',
true);
static makeDirParents($a_dir)
Create a new directory and all parent directories.
exportObject($a_type, $a_id, $a_target_release)
Export a container.
__construct(ilExportOptions $eo)
Constructor.
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static _lookupTitle($a_id)
lookup object title
manifestWriterEnd($a_type, $a_id, $a_target_release)
Write manifest footer.
manifestWriterBegin($a_type, $a_id, $a_target_release)
Write container manifest.
static _lookupObjId($a_id)
static lookupLastExport($a_obj_id, $a_type, $a_version='')
Lookup last export.
Stores information of creation date and versions of export files
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static _lookupType($a_id, $a_reference=false)
lookup object type
addContainer()
Add container description.
addSubitems($a_id, $a_type, $a_target_release)
Add subitems.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively