skt-t1-byungi/into-one
Composer 安装命令:
composer require skt-t1-byungi/into-one
包简介
merge files into one
README 文档
README
merge files into one
Description
여러 파일을 merge해서 관리하기 위한 용도.
Usage
namespace SktT1Byungi\IntoOne; $path = "test.bin"; var_dump(is_file($path)); //false; IntoOne::concat($path, function ($add) { $add->data('key1', 'abcd'); $add->path('key2', 'files/test.txt'); $add->resource('key3', fopen('php://stdin', 'r')); }); var_dump(is_file($path)); //true; $data = IntoOne::read($path, 'key1'); // $data == 'abcd' //for large file $content = ''; IntoOne::readChunks($path, "key2", function ($chunk) use ($content) { $content .= $chunk; }); //$content == file_get_contents("files/test.txt")
without facade
namespace SktT1Byungi\IntoOne; $path = "test.bin"; $resource = Resource::fopen($path, 'w'); $concat = new Concat($resource); $add = new Add($concat); $add->data('key1', 'abcd'); $add->path('key2', 'files/test.txt'); $add->resource('key3', fopen('php://stdin', 'r')); $concat->finish();
License
MIT
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-20