承接 hizpark/zip-mover 相关项目开发

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

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

hizpark/zip-mover

最新稳定版本:v1.0.1

Composer 安装命令:

composer require hizpark/zip-mover

包简介

Simple and reliable PHP utility for compressing and extracting a ZIP file

README 文档

README

Simple and reliable PHP utility for compressing and extracting a ZIP file

License Latest Version PHP Version Static Analysis Tests codecov CI

Lightweight PHP library for easily compressing the contents of a directory into a ZIP archive and extracting them. Provides a clean, intuitive API for efficient file packaging workflows.

📦 安装

composer require hizpark/zip-mover

📂 目录结构

src
├── Exception
│   └── ZipMoverException.php
└── ZipMover.php

🚀 用法示例

示例 1:压缩目录为 ZIP 文件

use Hizpark\ZipMover\ZipMover;

$mover = new ZipMover();
$mover->compress('/path/to/source-dir');

示例 2:解压 ZIP 文件到指定目录

use Hizpark\ZipMover\ZipMover;

$mover = new ZipMover();
$mover->extract('/path/to/destination-dir');

📐 接口说明

ZipMover::compress(string $srcPath): void

将指定目录压缩为 ZIP 文件

public function compress(string $srcPath): void;

ZipMover::extract(string $destPath): void

将 ZIP 文件内容解压到指定目录

public function extract(string $destPath): void;

ZipMover::clean(): void

清理临时文件

public function clean(): void;

🔍 静态分析

使用 PHPStan 工具进行静态分析,确保代码的质量和一致性:

composer stan

🎯 代码风格

使用 PHP-CS-Fixer 工具检查代码风格:

composer cs:chk

使用 PHP-CS-Fixer 工具自动修复代码风格问题:

composer cs:fix

✅ 单元测试

执行 PHPUnit 单元测试:

composer test

执行 PHPUnit 单元测试并生成代码覆盖率报告:

composer test:coverage

🤝 贡献指南

欢迎 Issue 与 PR,建议遵循以下流程:

  1. Fork 仓库
  2. 创建新分支进行开发
  3. 提交 PR 前请确保测试通过、风格一致
  4. 提交详细描述

📜 License

MIT License. See the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-29