当前位置: 首页>>代码示例>>PHP>>正文


PHP zipfile::last_dir方法代码示例

本文整理汇总了PHP中zipfile::last_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP zipfile::last_dir方法的具体用法?PHP zipfile::last_dir怎么用?PHP zipfile::last_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在zipfile的用法示例。


在下文中一共展示了zipfile::last_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dir

 function dir($name)
 {
     $name = str_replace("\\", "/", $name);
     $name = ereg_replace("^/|^//", "", $name);
     $name = ereg_replace("/\$|//\$", "", $name);
     self::$last_dir = $name;
     $fr = "PK";
     $fr .= "\n";
     // ver needed to extract
     $fr .= "";
     // gen purpose bit flag
     $fr .= "";
     // compression method
     $fr .= "";
     // last mod time and date
     $fr .= pack("V", 0);
     // crc32
     $fr .= pack("V", 0);
     //compressed filesize
     $fr .= pack("V", 0);
     //uncompressed filesize
     $fr .= pack("v", strlen($name));
     //length of pathname
     $fr .= pack("v", 0);
     //extra field length
     $fr .= $name;
     // end of "local file header" segment
     // no "file data" segment for path
     // "data descriptor" segment (optional but necessary if archive is not served as file)
     //$fr .= pack("V",$crc); //crc32
     //$fr .= pack("V",$c_len); //compressed filesize
     //$fr .= pack("V",$unc_len); //uncompressed filesize
     // add this entry to array
     self::$datasec[] = $fr;
     $new_offset = strlen(implode("", self::$datasec));
     // ext. file attributes mirrors MS-DOS directory attr byte, detailed
     // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp
     // now add to central record
     $cdrec = "PK";
     $cdrec .= "";
     // version made by
     $cdrec .= "\n";
     // version needed to extract
     $cdrec .= "";
     // gen purpose bit flag
     $cdrec .= "";
     // compression method
     $cdrec .= "";
     // last mod time & date
     $cdrec .= pack("V", 0);
     // crc32
     $cdrec .= pack("V", 0);
     //compressed filesize
     $cdrec .= pack("V", 0);
     //uncompressed filesize
     $cdrec .= pack("v", strlen($name));
     //length of filename
     $cdrec .= pack("v", 0);
     //extra field length
     $cdrec .= pack("v", 0);
     //file comment length
     $cdrec .= pack("v", 0);
     //disk number start
     $cdrec .= pack("v", 0);
     //internal file attributes
     $ext = "";
     $ext = "����";
     $cdrec .= pack("V", 16);
     //external file attributes  - 'directory' bit set
     $cdrec .= pack("V", self::$old_offset);
     //relative offset of local header
     self::$old_offset = $new_offset;
     $cdrec .= $name;
     // optional extra field, file comment goes here
     // save to array
     self::$ctrl_dir[] = $cdrec;
 }
开发者ID:rigidus,项目名称:ea,代码行数:77,代码来源:zipfile.php


注:本文中的zipfile::last_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。