PHPackages                             renjiangfeng/zip-file-php - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. renjiangfeng/zip-file-php

ActiveLibrary[File &amp; Storage](/categories/file-storage)

renjiangfeng/zip-file-php
=========================

0.0.4(6y ago)07MITPHPPHP ^7.0

Since May 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Renjiangfeng/ZipFilePhp)[ Packagist](https://packagist.org/packages/renjiangfeng/zip-file-php)[ RSS](/packages/renjiangfeng-zip-file-php/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (5)Used By (0)

ZipFilePhp
==========

[](#zipfilephp)

`zip-file-php`是一个根据配置文件对文件进行压缩打包的laravel包

安装
==

[](#安装)

`composer require renjiangfeng/zip-file-php`

开始使用
====

[](#开始使用)

##### 添加Provider

[](#添加provider)

- `config/app.php` 配置中的 `providers[]` 数组中添加：` Eric\ZipFilePhp\ZipFilePhpServiceProvider::class,`

##### 执行命令

[](#执行命令)

- php artisan vendor:publish --force --provider="Eric\\ZipFilePhp\\ZipFilePhpServiceProvider"

##### 会创建配置文件

[](#会创建配置文件)

- `confg/zip-file-php.php`

```
return [
    //以下配置只会用到一种
    'ignore_config' => [//不需要打包压缩的文件
        "/node_modules",
        "/public",
        "/storage/*.key",
        "/vendor",
        ".env",
        "/.idea",
        "/packages",
        "/.git",
        'index.php'
    ],
    'need_config'   => [ //需要打包压缩的文件
        '/app',
        '/config',
         'index.php'
    ]
];
```

分别有两种命令根据上面的两种配置进行打包压缩，配置文件写法基本沿用`.gitignore`文件的写法

### 1.忽略法

[](#1忽略法)

`php artisan zip:ignore ` 会根据 `ignore_config` 的列表忽略掉不需要打包的文件，可以自定义压缩包的名称， `php artisan zip:ignore demo` 会打包为`demo.zip`在根目录，默认`appignore.zip`

### 2.罗列法

[](#2罗列法)

`php artisan zip:forConfig ` 会根据 `need_config` 的罗列列表对文件进行打包,压缩包的名称同上，默认`app.zip`

\###备注 请确保PHP开启ZipArchive类，能实现压缩解压功能 ####Windows环境：

> Windows环境：
>
> - 首先需要从官网上下载，下载地址
> - 打开官网列表后需要查找适合自己的PHP版本和系统的zip，我的PHP版本是7.1的，这里我选择的版本号是1.13.5
> - 下载完后解压，把里面的php\_zip.dll文件放到PHP的扩展文件夹里 `Linux`可使用`php -i | grep extension_dir`找到扩展目录 `Windows`一般在PHP安装目录下的`ext`子目录中
> - 把`php_zip.dll`文件放进去后，打开PHP的配置文件`php.ini`，添加`extension=php_zip.dll`或者取消`extension=php_zip.dll`前的 `:`，保存后，重启apache/nginx服务器

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Total

4

Last Release

2195d ago

### Community

Maintainers

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

---

Top Contributors

[![Renjiangfeng](https://avatars.githubusercontent.com/u/33890971?v=4)](https://github.com/Renjiangfeng "Renjiangfeng (1 commits)")

### Embed Badge

![Health badge](/badges/renjiangfeng-zip-file-php/health.svg)

```
[![Health](https://phpackages.com/badges/renjiangfeng-zip-file-php/health.svg)](https://phpackages.com/packages/renjiangfeng-zip-file-php)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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