47 $this->export_dir .=
"_".$a_obj_id;
63 if(
$data[
'type'] !=
'file')
67 $file_parts = explode(
'.',$name);
68 if(!is_numeric($file_parts[0])
or (strcmp(
'xml',$file_parts[1]) != 0))
72 $file_info[$file_parts[0]][
'size'] =
$data[
'size'];
73 $file_info[$file_parts[0]][
'date'] = $file_parts[0];
75 if($xml = simplexml_load_file($this->export_dir.
'/'.$name))
78 foreach($xml->xpath(
'Record/Title') as
$title)
82 $file_info[$file_parts[0]][
'name'] =
$records;
85 return $file_info ? $file_info :
array();
96 if(!@is_dir($this->export_dir))
100 foreach(
ilUtil::getDir($this->export_dir) as $file_name => $file_data)
102 $files[$file_name] = $file_data;
118 if(!$fp = @fopen($this->export_dir.
'/'.
time().
'.xml',
'w+'))
120 $ilLog->write(__METHOD__.
': Cannot open file '.$this->export_dir.
'/'.
time().
'.xml');
122 require_once
'./Services/Exceptions/classes/class.ilException.php';
123 throw new ilException(
'Cannot write export file.');
140 if(!unlink($this->export_dir.
'/'.$a_timest.
'.xml'))
142 $ilLog->write(__METHOD__.
': Cannot delete file '.$this->export_dir.
'/'.$a_timest.
'.xml');
159 if(!@file_exists($this->export_dir.
'/'.$a_file_basename.
'.xml'))
161 $ilLog->write(__METHOD__.
': Cannot find file '.$this->export_dir.
'/'.$a_file_basename.
'.xml');
164 return $this->export_dir.
'/'.$a_file_basename.
'.xml';
175 if(!@is_dir($this->export_dir))
static makeDirParents($a_dir)
Create a new directory and all parent directories.
Base class for ILIAS Exception handling.
create($a_xml)
Create new export file from xml string.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
init()
init export directory
Add rich text string
The name of the decorator.
deleteByFileId($a_timest)
Delete by file id.
getAbsolutePathByFileId($a_file_basename)
Get absolut path by file id.
Create styles array
The data for the language used.
static getDataDir()
get data directory (outside webspace)
__construct($a_obj_id=null)
Constructor.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
readFilesInfo()
Read files info.