本文整理汇总了PHP中ilObjFile::setVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjFile::setVersion方法的具体用法?PHP ilObjFile::setVersion怎么用?PHP ilObjFile::setVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjFile
的用法示例。
在下文中一共展示了ilObjFile::setVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handlerBeginTag
/**
* 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
}
}
}