PHPackages                             changhorizon/zip-mover - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. changhorizon/zip-mover

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

changhorizon/zip-mover
======================

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

v1.1.2(4w ago)0381MITPHPPHP &gt;=8.2CI passing

Since Apr 29Pushed 4w ago1 watchersCompare

[ Source](https://github.com/changhorizon/zip-mover)[ Packagist](https://packagist.org/packages/changhorizon/zip-mover)[ RSS](/packages/changhorizon-zip-mover/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (12)Used By (1)

Zip Mover
=========

[](#zip-mover)

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

[![License](https://camo.githubusercontent.com/32323056e02d0e8aa3b7202022a11e260d3af370f96f301a53a01d8416f49332/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6368616e67686f72697a6f6e2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/32323056e02d0e8aa3b7202022a11e260d3af370f96f301a53a01d8416f49332/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6368616e67686f72697a6f6e2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)[![Latest Version](https://camo.githubusercontent.com/9f40966ae2903cd94b91ea939305486db3ed2470e83ada79db2705e089f372c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368616e67686f72697a6f6e2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/9f40966ae2903cd94b91ea939305486db3ed2470e83ada79db2705e089f372c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368616e67686f72697a6f6e2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)[![PHP Version](https://camo.githubusercontent.com/10b897c523f00fa3f8f7b54dfe73999190e622480655d5b5f011e31fc32a7111/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322d2d382e342d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/10b897c523f00fa3f8f7b54dfe73999190e622480655d5b5f011e31fc32a7111/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322d2d382e342d626c75653f7374796c653d666c61742d737175617265)[![Static Analysis](https://camo.githubusercontent.com/1a477f5e7e742a33c1ff5b685167579083a26c342c4e997fe056ea4ef7bea73e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617469635f616e616c797369732d5048505374616e2d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/1a477f5e7e742a33c1ff5b685167579083a26c342c4e997fe056ea4ef7bea73e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617469635f616e616c797369732d5048505374616e2d626c75653f7374796c653d666c61742d737175617265)[![Tests](https://camo.githubusercontent.com/72829871c802983bff15745f71c846973b36a6fea0bb5298dadaeeb690463604/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d504850556e69742d627269676874677265656e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/72829871c802983bff15745f71c846973b36a6fea0bb5298dadaeeb690463604/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d504850556e69742d627269676874677265656e3f7374796c653d666c61742d737175617265)[![codecov](https://camo.githubusercontent.com/526d04fb8533c0635fe479e32356801b0d3df1a1a4e2e294214a795ff8d5a5ff/68747470733a2f2f636f6465636f762e696f2f67682f6368616e67686f72697a6f6e2f7a69702d6d6f7665722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/changhorizon/zip-mover)[![CI](https://github.com/changhorizon/zip-mover/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/changhorizon/zip-mover/actions/workflows/ci.yml/badge.svg?style=flat-square)

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.

✨ 特性
----

[](#-特性)

- 🔒 SHA-256 integrity verification between compress and extract
- 📦 Zero runtime dependencies, PHP built-in ZipArchive only
- 🧹 Automatic temp file cleanup
- 🚀 Simple fluent API: compress → extract → clean

📦 安装
----

[](#-安装)

```
composer require changhorizon/zip-mover
```

📂 目录结构
------

[](#-目录结构)

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

🚀 用法示例
------

[](#-用法示例)

### 示例 1：压缩目录为 ZIP 文件

[](#示例-1压缩目录为-zip-文件)

```
use ChangHorizon\ZipMover\ZipMover;

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

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

[](#示例-2解压-zip-文件到指定目录)

```
use ChangHorizon\ZipMover\ZipMover;

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

📐 接口说明
------

[](#-接口说明)

### ZipMover::compress(string $srcPath): void

[](#zipmovercompressstring-srcpath-void)

> 将指定目录压缩为 ZIP 文件

```
public function compress(string $srcPath): void;
```

### ZipMover::extract(string $destPath): void

[](#zipmoverextractstring-destpath-void)

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

```
public function extract(string $destPath): void;
```

### ZipMover::clean(): void

[](#zipmoverclean-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
---------

[](#-license)

MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~91 days

Total

11

Last Release

29d ago

Major Versions

v0.3.3 → v1.0.02025-05-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/191742660?v=4)[ChangHorizon](/maintainers/changhorizon)[@changhorizon](https://github.com/changhorizon)

---

Top Contributors

[![changhorizon](https://avatars.githubusercontent.com/u/191742660?v=4)](https://github.com/changhorizon "changhorizon (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/changhorizon-zip-mover/health.svg)

```
[![Health](https://phpackages.com/badges/changhorizon-zip-mover/health.svg)](https://phpackages.com/packages/changhorizon-zip-mover)
```

###  Alternatives

[zhaohehe/laravel-echo-server

166.5k](/packages/zhaohehe-laravel-echo-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
