5include_once 
"./Services/Xml/classes/class.ilXmlWriter.php";
 
   58                parent::__construct();
 
   65                $this->file = & 
$file;
 
   76                $this->omit_header = $a_val;
 
   97                $this->target_dir_relative = $a_rel;
 
   98                $this->target_dir_absolute = $a_abs;
 
  127                  "obj_id" => 
"il_".IL_INST_ID.
"_file_".$this->file->getId(),
 
  128                  "version" => $this->file->getVersion(),
 
  129                  "size" => $this->file->getFileSize(),
 
  130                  "type" => $this->file->getFileType()
 
  134        $this->
xmlElement(
"Filename",
null,$this->file->getFileName());
 
  136                $this->
xmlElement(
"Title",  
null,$this->file->getTitle());
 
  137        $this->
xmlElement(
"Description",  
null,$this->file->getDescription());
 
  138        $this->
xmlElement(
"Rating",  
null,(
int)$this->file->hasRating());
 
  140        if ($this->attachFileContents)
 
  142            $filename = $this->file->getDirectory($this->file->getVersion()).
"/".$this->file->getFileName();
 
  147                                        $attribs = array(
"mode" =>
"COPY");
 
  148                                        copy(
$filename, $this->target_dir_absolute.
"/".$this->file->getFileName());
 
  149                                        $content = $this->target_dir_relative.
"/".$this->file->getFileName();
 
  150                                        $this->
xmlElement(
"Content",$attribs, $content);
 
  155                                        $attribs = array(
'mode' => 
"REST");
 
  156                                        include_once 
'./Services/WebServices/Rest/classes/class.ilRestFileStorage.php';
 
  158                                        $tmpname = $fs->storeFileForRest(base64_encode(@file_get_contents(
$filename)));
 
  159                                        $this->
xmlElement(
"Content",$attribs, $tmpname);
 
  164                                        $content = @file_get_contents(
$filename);
 
  165                                        $attribs = array(
"mode" =>
"PLAIN");
 
  168                                                $attribs [
"mode"] =
"ZLIB";
 
  169                                                $content = @gzcompress($content, 9);
 
  172                                                $attribs [
"mode"] =
"GZIP";
 
  173                                                $content = @gzencode($content, 9);
 
  175                                        $content = base64_encode($content);
 
  176                                        $this->
xmlElement(
"Content",$attribs, $content);
 
  182        include_once(
"./Services/History/classes/class.ilHistory.php");
 
  186                if (count($versions)) {
 
  189                        $info_params = 
$version[
"info_params"];
 
  190                        list(
$filename,$history_id) = explode(
",",$info_params);
 
  194                          "usr_id" => 
"il_".IL_INST_ID.
"_usr_".
$version[
"user_id"]
 
  219                        $this->
xmlSetDtdDef(
"<!DOCTYPE File PUBLIC \"-//ILIAS//DTD FileAdministration//EN\" \"".ILIAS_HTTP_PATH.
"/xml/ilias_file_3_8.dtd\">");
 
An exception for terminatinating execution or to throw for unit testing.
Class to report exception.
static $ID_DEFLATE_METHOD_MISMATCH
static $CONTENT_ATTACH_GZIP_ENCODED
setAttachFileContents($attachFileContents)
set attachment content mode
static $CONTENT_ATTACH_REST
setFileTargetDirectories($a_rel, $a_abs)
Set file target directories.
setOmitHeader($a_val)
Set omit header.
static $CONTENT_ATTACH_COPY
static $CONTENT_ATTACH_ENCODED
getOmitHeader()
Get omit header.
static $CONTENT_ATTACH_NO
static $CONTENT_ATTACH_ZLIB_ENCODED
static _getEntriesForObject($a_obj_id, $a_obj_type="")
get all history entries for an object
static date_mysql2time($mysql_date_time)
xmlEndTag($tag)
Writes an endtag.
xmlDumpMem($format=TRUE)
Returns xml document from memory.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlHeader()
Writes xml header @access public.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)