59 if(
$data[
'type'] !=
'file')
63 $file_parts = explode(
'.',$name);
64 if(!is_numeric($file_parts[0]) or (strcmp(
'xml',$file_parts[1]) != 0))
68 $file_info[$file_parts[0]][
'size'] =
$data[
'size'];
69 $file_info[$file_parts[0]][
'date'] = $file_parts[0];
71 if($xml = simplexml_load_file($this->export_dir.
'/'.$name))
74 foreach($xml->xpath(
'Record/Title') as $title)
78 $file_info[$file_parts[0]][
'name'] =
$records;
81 return $file_info ? $file_info : array();
92 if(!@is_dir($this->export_dir))
96 foreach(
ilUtil::getDir($this->export_dir) as $file_name => $file_data)
98 $files[$file_name] = $file_data;
100 return $files ? $files : array();
114 if(!$fp = @fopen($this->export_dir.
'/'.time().
'.xml',
'w+'))
116 $ilLog->write(__METHOD__.
': Cannot open file '.$this->export_dir.
'/'.time().
'.xml');
117 $ilErr->raiseError(
'Cannot write export file.',$ilErr->WARNING);
134 if(!unlink($this->export_dir.
'/'.$a_timest.
'.xml'))
136 $ilLog->write(__METHOD__.
': Cannot delete file '.$this->export_dir.
'/'.$a_timest.
'.xml');
153 if(!@file_exists($this->export_dir.
'/'.$a_file_basename.
'.xml'))
155 $ilLog->write(__METHOD__.
': Cannot find file '.$this->export_dir.
'/'.$a_file_basename.
'.xml');
158 return $this->export_dir.
'/'.$a_file_basename.
'.xml';
169 if(!@is_dir($this->export_dir))
static makeDirParents($a_dir)
Create a new directory and all parent directories.
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
deleteByFileId($a_timest)
Delete by file id.
getAbsolutePathByFileId($a_file_basename)
Get absolut path by file id.
static getDataDir()
get data directory (outside webspace)
__construct()
Constructor.
readFilesInfo()
Read files info.