定制 digitaldogsbody/mingulay 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digitaldogsbody/mingulay

最新稳定版本:0.2.1

Composer 安装命令:

composer require digitaldogsbody/mingulay

包简介

A Zip file parser and range extractor

README 文档

README

The western cliffs with the stack of Arnamuil in the centre and Bagh na h-Aoineig to the left.

Tony Kinghorn / Western Cliffs of Mingulay / CC BY-SA 2.0

Overview

Mingulay is a PHP library for parsing file information out of Zip files. It searches for the End of Central Directory Record, parses out the data, and then uses this to retrieve the Central Directory Records which contain the metadata of the files in the Zip.

What's in a name?

Mingulay is an island in the Hebrides, an archipelago off the west coast of my home country of Scotland, and so it seemed a fitting pick as this library was developed as a contribution towards the fantastic Archipelago project (GitHub).

Installation

Mingulay can be installed via Composer: composer require digitaldogsbody/mingulay or alternatively you can clone the repo or download a zip from the releases page and include the contents of src/ in your project.

Documentation

Some basic autogenerated PHPDoc documentation is available on GitHub pages: https://digitaldogsbody.github.io/mingulay/. This is automatically updated every time a commit is made to the main branch, and so should always be up-to-date with the latest code.

Versioning

Mingulay follows Semantic Versioning practices. Until release 1.0.0, the interfaces and functionality should be considered unstable and likely to change.

Usage

Mingulay requires an object that implements the Mingulay\SeekerInterface interface. A LocalFileSeeker implementation is provided for working with Zip files on disk.

$seeker = new \Mingulay\Seeker\LocalFileSeeker("test/fixtures/single-file.zip");
$zip_info = new \Mingulay\ZipRangeReader($seeker);
var_dump($zip_info->files);
array(1) {
  'README.md'=>
  array(6) {
    ["file_name"]=>
    string(9) "README.md"
    ["offset"]=>
    int(0)
    ["compressed_size"]=>
    int(43)
    ["uncompressed_size"]=>
    int(43)
    ["CRC32"]=>
    string(8) "C6E036CC"
    ["comment"]=>
    string(0) ""
  }
}

Pointers to retrieve individual decompressed files can be acquired with the getStream() function:

$seeker = new \Mingulay\Seeker\LocalFileSeeker("test/fixtures/multiple-files.zip");
$zip_info = new \Mingulay\ZipRangeReader($seeker);
$fp = $zip_info->getStream("LICENSE");
$local_fp = fopen("/tmp/example", "wb");
while(!feof($fp)) {
    fwrite($local_fp, fread($fp, 2048));
}
fclose($local_fp);
fclose($fp);

Acknowledgements and thanks

License

AGPL-3

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2022-09-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固