/** * handler for begin of element * * @param resource $a_xml_parser xml parser * @param string $a_name element name * @param array $a_attribs element attributes array * @throws ilFileException when obj id != - 1 and if it it does not match the id in the xml * or deflation mode is not supported */ function handlerBeginTag($a_xml_parser, $a_name, $a_attribs) { global $ilErr; global $ilLog; switch ($a_name) { case 'File': if (isset($a_attribs["obj_id"])) { $read_obj_id = ilUtil::__extractId($a_attribs["obj_id"], IL_INST_ID); if ($this->obj_id != -1 && (int) $read_obj_id != -1 && (int) $this->obj_id != (int) $read_obj_id) { throw new ilFileException("Object IDs (xml {$read_obj_id} and argument " . $this->obj_id . ") do not match!", ilFileException::$ID_MISMATCH); } } if (isset($a_attribs["type"])) { $this->file->setFileType($a_attribs["type"]); } $this->file->setVersion($this->file->getVersion() + 1); break; case 'Content': $this->tmpFilename = ilUtil::ilTempnam(); $this->mode = ilFileXMLParser::$CONTENT_NOT_COMPRESSED; $this->isReadingFile = true; #echo $a_attribs["mode"]; if (isset($a_attribs["mode"])) { if ($a_attribs["mode"] == "GZIP") { if (!function_exists("gzread")) { throw new ilFileException("Deflating with gzip is not supported", ilFileException::$ID_DEFLATE_METHOD_MISMATCH); } $this->mode = ilFileXMLParser::$CONTENT_GZ_COMPRESSED; } elseif ($a_attribs["mode"] == "ZLIB") { if (!function_exists("gzuncompress")) { throw new ilFileException("Deflating with zlib (compress/uncompress) is not supported", ilFileException::$ID_DEFLATE_METHOD_MISMATCH); } $this->mode = ilFileXMLParser::$CONTENT_ZLIB_COMPRESSED; } elseif ($a_attribs["mode"] == "COPY") { $this->mode = ilFileXMLParser::$CONTENT_COPY; } elseif ($a_attribs['mode'] == 'REST') { $this->mode = ilFileXMLParser::$CONTENT_REST; } // end-patch fm } } }