承接 codebites/cli-7zip 相关项目开发

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

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

codebites/cli-7zip

Composer 安装命令:

composer require codebites/cli-7zip

包简介

A wrapper for 7-zip CLI to compress, decompress and manipulate archives.

README 文档

README

Description

This is a simple wrapper around the CLI binary of 7-zip. I tried to abstract the most commonly used commands like verify, extract, create and add. It will try to find the 7zz binary automatically on your system. I chose to use 7zz because it's statically linked and standalone thus perfect for shipping without any dependencies. You are also free to use other compatible binaries like 7zr or 7za by passing it to the constructor. If it can't find 7zz on your system, it will default to the bundled binary from the ./bin folder. I only bundle the Linux x86_64 for now. You also have the possibility to point to additional paths in which the library should look for the binary via the constructor of the Cli7zip class.

Because we use the full version we have support for all archive formats, not only .7z. Taken from the website of 7-zip it should support the following formats:

  • Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
  • Unpacking only: APFS, AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VHDX, VMDK, XAR and Z

Prerequisites

  • PHP >= 8.2

Install

  • composer require codebites/cli-7zip

Usage

<?php

use Codebites\Cli7zip\Cli7zip;

// Init
$cli7zip = new Cli7zip();

// Init with custom paths
$cli7zip = new Cli7zip('7zz', ['/path/to/my/binaries_folder']);

// Extract archive without folder creation
$success = $cli7zip->extractArchive('/my/archive.7z', '/my/existing/target/folder');

// Extract archive with folder creation
$success = $cli7zip->extractArchive('/my/archive.7z', '/my/non-existing/target/folder', true);

// Compress directory as 7z
$success = $cli7zip->compressDir('/my/folder/to/compress', '/my/archive.7z', '7z');

// Compress directory as Zip
$archivePath = $cli7zip->compressDir('/my/folder/to/compress', '/my/archive.zip', 'zip');

// Add files to existing archive
$success = $cli7zip->addFilesToArchive('/my/archive.7z', '/my/first/file.txt', '/my/seconde/file2.txt');

// Add string as file to existing archive
$success = $cli7zip->addStringToArchive('/my/archive.7z', 'Hello, World!', 'filename.txt');

Warning

DO NOT USE IN PRODUCTION! This is highly experimental and not battle-tested. I wrote this for a use-case I had in about an hour. If there is any interest I will try to continue to improve this library.

License Information

This project includes binaries from 7-zip downloaded from Github. No modifications are made. The 7-zip binaries are distributed under the GNU Lesser General Public License (LGPL). The license is included in this repository.

  • The 7-zip binaries are located in the bin directory.
  • The LGPL license can be found in licenses/LGPL-3.0.txt.

codebites/cli-7zip 适用场景与选型建议

codebites/cli-7zip 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 534 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「compression」 「cli」 「wrapper」 「zip」 「archive」 「7z」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 codebites/cli-7zip 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 codebites/cli-7zip 我们能提供哪些服务?
定制开发 / 二次开发

基于 codebites/cli-7zip 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-08