takuya/php-7z-cmd-wrapper 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

takuya/php-7z-cmd-wrapper

最新稳定版本:0.1.2

Composer 安装命令:

composer require takuya/php-7z-cmd-wrapper

包简介

7z Archiver Command Wrapper

README 文档

README

7z command supports several type of archive.

requirements

sudo apt install p7zip-full

rar will be installed as non-free

sudo apt install p7zip-rar # debian non-free

usage

Access with file name.

$a7z = new Archive7zReader("sample.zip");
foreach( $a7z->files() as $name) {
  $bin = $a7z->content($name);
}

Access with index.

$a7z = new Archive7zReader("sample.zip");
$bin = $a7z->at(0);

limitations

currently, this project aimed at READING archive. write/append not yet.

character encodings.(reading archive)

7z command will encode filenames by shell ENV[LANG]. So we should take care of encoding using shell env LANG='XXX' and php mb_string.

cp932(jp/windows/filename) example. #01 using utf8

$a = new Archive7zReader($f);
$a->setLang('ja_JP.UTF8');
$file_name = $a->files()[1];
$file_name =   $name = mb_convert_encoding($file_name,"UTF8","UTF8,CP932");

cp932(jp/windows/filename) example. #02 using cp932

$a = new Archive7zReader($f);
$a->setLang('ja_JP.SJIS');
$file_name = $a->files()[1];
$file_name =   $name = mb_convert_encoding($file_name,"UTF8","CP932");

Installation from github

repo=git@github.com:takuya/php-7z-cmd-wrapper.git
composer config repositories.takuya/php-7z-cmd-wrapper vcs $repo
composer require takuya/php-7z-cmd-wrapper

Installation from packagist

composre require takuya/php-7z-cmd-wrapper

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2021-08-23