承接 dmitriynyu/chunked-file-reader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dmitriynyu/chunked-file-reader

Composer 安装命令:

composer require dmitriynyu/chunked-file-reader

包简介

Class ChunkedFileReader helps you to read content from text files without loading whole file contents in RAM.

README 文档

README

Class ChunkedFileReader helps you to read content from text files without loading whole file contents in RAM. It implements a SeekableIterator and allows you to read file chunk by chunk.

Warning!

If you have 32-bit installation of PHP, this class won't work with files large than 2 gigabytes. Use 64-bit and check value of PHP_INT_MAX - this is maximum in bytes that you will be able to traverse. See fseek() for more details on this problem.

Installation

Use Composer to install package or download and include files manually to your project.

Usage

Make sure ChunkedFileReader is installed and available in your namespace. You can traverse file whatever way you prefer. You should have class than can handle and process chunks.

$chunkSize = 128;
$reader = new ChunkedFileReader($path, $chunkSize);
$chunkParser = new MyCustomChunkParserThatKnowsWhatToDoWithChunks();
foreach($reader as $chunkPosition => $chunk) {
    // chunks will contain 128 bytes of data
    // in order of appearance until EOF
    $chunkParser->process($chunk)
}

Development

This package needs improvement, any contribution is welcomed.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固