<h1 align="center"><img src="logo.svg" alt="PhpZip" width="250" height="51"></h1>
`PhpZip` is a php-library for extended work with ZIP-archives.
[![Packagist Version](https://img.shields.io/packagist/v/nelexa/zip.svg)](https://packagist.org/packages/nelexa/zip)
[![Packagist Downloads](https://img.shields.io/packagist/dt/nelexa/zip.svg?color=%23ff007f)](https://packagist.org/packages/nelexa/zip)
[![Code Coverage](https://scrutinizer-ci.com/g/Ne-Lexa/php-zip/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Ne-Lexa/php-zip/?branch=master)
[![Build Status](https://github.com/Ne-Lexa/php-zip/workflows/build/badge.svg)](https://github.com/Ne-Lexa/php-zip/actions)
[![License](https://img.shields.io/packagist/l/nelexa/zip.svg)](https://github.com/Ne-Lexa/php-zip/blob/master/LICENSE)
[Russian Documentation](README.RU.md)
### Versions & Dependencies
| Version | PHP | Documentation |
| ------------------- | ---------- | -------------------------------------------------------------------- |
| ^4.0 (master) | ^7.4\|^8.0 | current |
| ^3.0 | ^5.5\|^7.0 | [Docs v3.3](https://github.com/Ne-Lexa/php-zip/blob/3.3.3/README.md) |
Table of contents
-----------------
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Examples](#examples)
- [Glossary](#glossary)
- [Documentation](#documentation)
+ [Overview of methods of the class `\PhpZip\ZipFile`](#overview-of-methods-of-the-class-phpzipzipfile)
+ [Creation/Opening of ZIP-archive](#creationopening-of-zip-archive)
+ [Reading entries from the archive](#reading-entries-from-the-archive)
+ [Iterating entries](#iterating-entries)
+ [Getting information about entries](#getting-information-about-entries)
+ [Adding entries to the archive](#adding-entries-to-the-archive)
+ [Deleting entries from the archive](#deleting-entries-from-the-archive)
+ [Working with entries and archive](#working-with-entries-and-archive)
+ [Working with passwords](#working-with-passwords)
+ [Undo changes](#undo-changes)
+ [Saving a file or output to a browser](#saving-a-file-or-output-to-a-browser)
+ [Closing the archive](#closing-the-archive)
- [Running the tests](#running-the-tests)
- [Changelog](#changelog)
- [Upgrade](#upgrade)
+ [Upgrade version 3 to version 4](#upgrade-version-3-to-version-4)
+ [Upgrade version 2 to version 3](#upgrade-version-2-to-version-3)
### Features
- Opening and unzipping zip files.
- Creating ZIP-archives.
- Modifying ZIP archives.
- Pure php (not require extension `php-zip` and class `\ZipArchive`).
- It supports saving the archive to a file, outputting the archive to the browser, or outputting it as a string without saving it to a file.
- Archival comments and comments of individual entry are supported.
- Get information about each entry in the archive.
- Only the following compression methods are supported:
+ No compressed (Stored).
+ Deflate compression.
+ BZIP2 compression with the extension `php-bz2`.
- Support for `ZIP64` (file size is more than 4 GB or the number of entries in the archive is more than 65535).
- Working with passwords
> **Attention!**
>
> For 32-bit systems, the `Traditional PKWARE Encryption (ZipCrypto)` encryption method is not currently supported.
> Use the encryption method `WinZIP AES Encryption`, whenever possible.
+ Set the password to read the archive for all entries or only for some.
+ Change the password for the archive, including for individual entries.
+ Delete the archive password for all or individual entries.
+ Set the password and/or the encryption method, both for all, and for individual entries in the archive.
+ Set different passwords and encryption methods for different entries.
+ Delete the password for all or some entries.
+ Support `Traditional PKWARE Encryption (ZipCrypto)` and `WinZIP AES Encryption` encryption methods.
+ Set the encryption method for all or individual entries in the archive.
### Requirements
- `PHP` >= 7.4 or `PHP` >= 8.0 (preferably 64-bit).
- Optional php-extension `bzip2` for BZIP2 compression.
- Optional php-extension `openssl` for `WinZip Aes Encryption` support.
### Installation
`composer require nelexa/zip`
Latest stable version: [![Latest Stable Version](https://poser.pugx.org/nelexa/zip/v/stable)](https://packagist.org/packages/nelexa/zip)
### Examples
```php
// create new archive
$zipFile = new \PhpZip\ZipFile();
try{
$zipFile
->addFromString('zip/entry/filename', 'Is file content') // add an entry from the string
->addFile('/path/to/file', 'data/tofile') // add an entry from the file
->addDir(__DIR__, 'to/path/') // add files from the directory
->saveAsFile($outputFilename) // save the archive to a file
->close(); // close archive
// open archive, extract, add files, set password and output to browser.
$zipFile
->openFile($outputFilename) // open archive from file
->extractTo($outputDirExtract) // extract files to the specified directory
->deleteFromRegex('~^\.~') // delete all hidden (Unix) files
->addFromString('dir/file.txt', 'Test file') // add a new entry from the string
->setPassword('password') // set password for all entries
->outputAsAttachment('library.jar'); // output to the browser without saving to a file
}
catch(\PhpZip\Exception\ZipException $e){
// handle exception
}
finally{
$zipFile->close();
}
```
Other examples can be found in the `tests/` folder
### Glossary
**Zip Entry** - file or folder in a ZIP-archive. Each entry in the archive has certain properties, for example: file name, compression method, encryption method, file size before compression, file size after compression, CRC32 and others.
### Documentation:
#### Overview of methods of the class `\PhpZip\ZipFile`
- [ZipFile::__construct](#zipfile__construct) - initializes the ZIP archive.
- [ZipFile::addAll](#zipfileaddall) - adds all entries from an array.
- [ZipFile::addDir](#zipfileadddir) - adds files to the archive from the directory on the specified path without subdirectories.
- [ZipFile::addDirRecursive](#zipfileadddirrecursive) - adds files to the archive from the directory on the specified path with subdirectories.
- [ZipFile::addEmptyDir](#zipfileaddemptydir) - add a new directory.
- [ZipFile::addFile](#zipfileaddfile) - adds a file to a ZIP archive from the given path.
- [ZipFile::addSplFile](#zipfileaddsplfile) - adds a `\SplFileInfo` to a ZIP archive.
- [ZipFile::addFromFinder](#zipfileaddfromfinder) - adds files from the `Symfony\Component\Finder\Finder` to a ZIP archive.
- [ZipFile::addFilesFromIterator](#zipfileaddfilesfromiterator) - adds files from the iterator of directories.
- [ZipFile::addFilesFromGlob](#zipfileaddfilesfromglob) - adds files from a directory by glob pattern without subdirectories.
- [ZipFile::addFilesFromGlobRecursive](#zipfileaddfilesfromglobrecursive) - adds files from a directory by glob pattern with subdirectories.
- [ZipFile::addFilesFromRegex](#zipfileaddfilesfromregex) - adds files from a directory by PCRE pattern without subdirectories.
- [ZipFile::addFilesFromRegexRecursive](#zipfileaddfilesfromregexrecursive) - adds files from a directory by PCRE pattern with subdirectories.
- [ZipFile::addFromStream](#zipfileaddfromstream) - adds an entry from the stream to the ZIP archive.
- [ZipFile::addFromString](#zipfileaddfromstring) - adds a file to a ZIP archive using its contents.
- [ZipFile::close](#zipfileclose) - close the archive.
- [ZipFile::count](#zipfilecount) - returns the number of entries in the archive.
- [ZipFile::deleteFromName](#zipfiledeletefromname) - deletes an entry in the archive using its name.
- [ZipFile::deleteFromGlob](#zipfiledeletefromglob) - deletes an entries in the archive using glob pattern.
- [ZipFile::delete
没有合适的资源?快使用搜索试试~ 我知道了~
最新TVBOX绿豆U8影视APP源码 新增带直播管理以及加密功能
共2000个文件
js:1204个
html:212个
json:163个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 118 浏览量
2025-01-07
15:06:01
上传
评论
收藏 60.9MB ZIP 举报
温馨提示
最新版绿豆盒子UI8版本影视APP源码震撼发布,后台新增了添加直播源功能, 可批量导入直播源,并且直播源支持加密!作为UI6的升级版,UI8不仅修复了前一版本中存在的一些BUG, 还提供了五套不同的UI界面供用户选择。其它方面跟上个版本差不多,该版本有以下特色功能: 在线管理Tvbox解析 在线自定义Tvbox首页布局 批量添加会员信息并支持导出 批量生成卡密并支持导出 直播列表管理功能 支持在线升级TVBOX系统 代理提卡服务 仓库、接口后台管理 自带收银台(免签约) 第三方支付(微信、支付宝、易支付)无缝整合 点播及直播支持设置会员制 APP版本推送(在线更新) 请注意,此版本为UI8前端APK反编译版,其后台采用的是最新的FastAdmin框架,与之前的UI6版本不兼容。 此版本暂时只提供TV端源码,手机版将在后期发布,欢迎收藏本站链接,随时关注本站最新动态。 以下为UI6、UI7手机和TV双端版本以及神马、tvbox等其它优化版本链接
资源推荐
资源详情
资源评论
收起资源包目录
最新TVBOX绿豆U8影视APP源码 新增带直播管理以及加密功能 (2000个子文件)
backend.min.css 399KB
frontend.min.css 384KB
bootstrap.css 143KB
bootstrap.css 141KB
fastadmin.css 134KB
bootstrap.min.css 122KB
bootstrap.min.css 119KB
fastadmin.min.css 114KB
_all-skins.css 102KB
selectpage.css 40KB
font-awesome.css 37KB
backend.css 35KB
style.css 34KB
style.css 34KB
style.css 31KB
style.css 31KB
font-awesome.min.css 30KB
style.min.css 29KB
style.min.css 27KB
bootstrap-theme.css 25KB
bootstrap-table-group-by.css 24KB
bootstrap-table-group-by.css 24KB
frontend.css 23KB
bootstrap-theme.min.css 23KB
layer.css 15KB
layer.css 14KB
bootstrap-select.css 13KB
bootstrap-select.min.css 11KB
dropzone.min.css 10KB
bootstrap-datetimepicker.css 9KB
daterangepicker.css 8KB
bootstrap-datetimepicker.min.css 8KB
toastr.css 7KB
bootstrap-table.css 7KB
bootstrap-table.css 7KB
skin-black-purple.css 7KB
skin-black-yellow.css 7KB
skin-black-green.css 7KB
skin-black-pink.css 7KB
skin-black-blue.css 7KB
skin-black-red.css 7KB
toastr.min.css 6KB
skin-blue.css 6KB
skin-purple.css 6KB
skin-black.css 6KB
layer.css 6KB
bootstrap-table.min.css 6KB
skin-black-light.css 5KB
layer.css 5KB
skin-yellow-light.css 5KB
skin-purple-light.css 5KB
skin-green-light.css 5KB
skin-blue-light.css 5KB
skin-red-light.css 5KB
theme.css 5KB
slider.css 5KB
qunit.css 5KB
tinycss.css 5KB
skin-yellow.css 4KB
skin-green.css 4KB
skin-red.css 4KB
jquery.validator.css 4KB
style.css 3KB
style.css 3KB
common.css 3KB
common.css 3KB
city-picker.css 3KB
city-picker.css 3KB
index.css 2KB
bootstrap-datetimepicker-standalone.css 2KB
base.css 2KB
base.css 2KB
base.css 2KB
website.css 2KB
prettify.css 2KB
user.css 1KB
style.css 842B
bootstrap-table-reorder-rows.css 819B
bootstrap-table-reorder-rows.css 819B
iconfont.css 797B
prettify-1.0.css 762B
prettify-1.0.css 762B
prettify-1.0.css 762B
bootstrap-table-fixed-columns.css 739B
bootstrap-table-fixed-columns.css 739B
prettify.css 655B
bootstrap-table-tree-column.css 582B
bootstrap-table-tree-column.css 582B
bootstrap-table-sticky-header.css 416B
bootstrap-table-sticky-header.css 416B
bootstrap-table-multiple-selection-row.css 306B
bootstrap-table-multiple-selection-row.css 306B
ConfigForm.css 301B
bootstrap-table-click-edit-row.css 287B
bootstrap-table-click-edit-row.css 287B
bootstrap-table-filter-control.css 190B
bootstrap-table-filter-control.css 190B
bootstrap-table-jumpto.css 148B
bootstrap-table-jumpto.css 148B
bootstrap-table-group-by.css 129B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
希希分享
- 粉丝: 7163
- 资源: 3873
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【新增】-071 -科技公司薪酬体系设计方案.doc
- 【新增】-077 -零售药店薪酬管理方案.doc
- 【新增】-078 -零售终端店铺薪酬方案.doc
- 【新增】-079 -贸易公司销售薪酬方案.doc
- 【新增】-081 -某医院薪酬管理体系设计方案).doc
- 【新增】-080 -贸易公司薪酬与绩效考核方案.doc
- 【新增】-089 -汽车4S店岗位级别薪资方案.doc
- 【新增】-094 -汽车销售专营店绩效考核、薪酬制度.doc
- 【新增】-091 -汽车4S店薪酬制度(丰田).doc
- 【新增】-090 -汽车4S店薪酬方案(上海大众).doc
- 【新增】-085 -农业科技薪酬体系设计方案.doc
- 【新增】-097 -软件开发公司薪酬制度.doc
- 全开源跑腿小程序/智能派单/系统派单/同城配送/校园跑腿/预约取件/用户端+骑手端
- 【新增】-101 -生产制造薪酬体系方案.doc
- 【新增】-104 -食品公司薪酬方案.doc
- 【新增】-108 -食品生产企业薪酬福利制度.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功