PHPackages                             hizpark/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. hizpark/zip-mover

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

hizpark/zip-mover
=================

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

v1.0.1(1y ago)0451MITPHPPHP &gt;=8.2CI passing

Since Apr 29Pushed 1y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (4)Versions (9)Used By (1)

Zip Mover
=========

[](#zip-mover)

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

[![License](https://camo.githubusercontent.com/081e27283ee8153042b5473a2783cf14603b7f081e48a0724280f6addeb7919c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68697a7061726b2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/081e27283ee8153042b5473a2783cf14603b7f081e48a0724280f6addeb7919c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68697a7061726b2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)[![Latest Version](https://camo.githubusercontent.com/d4f7ba55ffb10b8b7585360e8ac8c93d93e4ea98253cffbd6b1b8dc42ae0fa53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68697a7061726b2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d4f7ba55ffb10b8b7585360e8ac8c93d93e4ea98253cffbd6b1b8dc42ae0fa53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68697a7061726b2f7a69702d6d6f7665723f7374796c653d666c61742d737175617265)[![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/9eaec411e60e7d011124e1edcb345338e836b4c47f9da54eee7fe12bd2111a33/68747470733a2f2f636f6465636f762e696f2f67682f68697a7061726b2f7a69702d6d6f7665722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/hizpark/zip-mover)[![CI](https://github.com/hizpark/zip-mover/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/hizpark/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.

📦 安装
----

[](#-安装)

```
composer require hizpark/zip-mover
```

📂 目录结构
------

[](#-目录结构)

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

🚀 用法示例
------

[](#-用法示例)

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

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

```
use Hizpark\ZipMover\ZipMover;

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

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

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

```
use Hizpark\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

32

—

LowBetter than 72% of packages

Maintenance49

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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 ~1 days

Total

8

Last Release

370d ago

Major Versions

v0.3.3 → v1.0.02025-05-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebedf625b7a40647c79c0b4788067638b60eb50ed9d0cab47ea0852e03772020?d=identicon)[changhorizon](/maintainers/changhorizon)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[cerdic/css-tidy

CSSTidy is a CSS minifier

2092.0M6](/packages/cerdic-css-tidy)[lochmueller/calendarize

Create a structure for timely controlled tables (e.g. events) and one plugin for the different output of calendar views (list, detail, month, year, day, week...). The extension is shipped with one default event table, but you can also 'calendarize' your own table/model. It is completely independent and configurable! Use your own models as event items in this calender. Development on https://github.com/lochmueller/calendarize

77152.6k12](/packages/lochmueller-calendarize)[sitegeist/kaleidoscope

Responsive-images for Neos

29352.4k10](/packages/sitegeist-kaleidoscope)[jurchiks/numbers2words

It spells numbers (and currencies)!

20172.1k3](/packages/jurchiks-numbers2words)[giauphan/laravel-qr-code

QR Code Generator for PHP wrapper for Laravel

2765.4k1](/packages/giauphan-laravel-qr-code)[syholloway/mrcolor

Color manipulation tools and format conversion for PHP

14149.6k](/packages/syholloway-mrcolor)

PHPackages © 2026

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