`PhpZip`
========
`PhpZip` is a php-library for extended work with ZIP-archives.
[![Build Status](https://travis-ci.org/Ne-Lexa/php-zip.svg?branch=master)](https://travis-ci.org/Ne-Lexa/php-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)
[![Latest Stable Version](https://poser.pugx.org/nelexa/zip/v/stable)](https://packagist.org/packages/nelexa/zip)
[![Total Downloads](https://poser.pugx.org/nelexa/zip/downloads)](https://packagist.org/packages/nelexa/zip)
[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%205.5-8892BF.svg)](https://php.net/)
[![License](https://poser.pugx.org/nelexa/zip/license)](https://packagist.org/packages/nelexa/zip)
[Russian Documentation](README.RU.md)
Table of contents
-----------------
- [Features](#Features)
- [Requirements](#Requirements)
- [Installation](#Installation)
- [Examples](#Examples)
- [Glossary](#Glossary)
- [Documentation](#Documentation)
+ [Overview of methods of the class `\PhpZip\ZipFile`](#Documentation-Overview)
+ [Creation/Opening of ZIP-archive](#Documentation-Open-Zip-Archive)
+ [Reading entries from the archive](#Documentation-Open-Zip-Entries)
+ [Iterating entries](#Documentation-Zip-Iterate)
+ [Getting information about entries](#Documentation-Zip-Info)
+ [Adding entries to the archive](#Documentation-Add-Zip-Entries)
+ [Deleting entries from the archive](#Documentation-Remove-Zip-Entries)
+ [Working with entries and archive](#Documentation-Entries)
+ [Working with passwords](#Documentation-Password)
+ [zipalign - alignment tool for Android (APK) files](#Documentation-ZipAlign-Usage)
+ [Undo changes](#Documentation-Unchanged)
+ [Saving a file or output to a browser](#Documentation-Save-Or-Output-Entries)
+ [Closing the archive](#Documentation-Close-Zip-Archive)
- [Running the tests](#Running-Tests)
- [Changelog](#Changelog)
- [Upgrade](#Upgrade)
+ [Upgrade version 2 to version 3.0](#Upgrade-v2-to-v3)
### <a name="Features"></a> 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).
- Built-in support for aligning the archive to optimize Android packages (APK) [`zipalign`](https://developer.android.com/studio/command-line/zipalign.html).
- Working with passwords for PHP 5.5
> **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.
### <a name="Requirements"></a> Requirements
- `PHP` >= 5.5 (preferably 64-bit).
- Optional php-extension `bzip2` for BZIP2 compression.
- Optional php-extension `openssl` or `mcrypt` for `WinZip Aes Encryption` support.
### <a name="Installation"></a> 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)
### <a name="Examples"></a> 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
### <a name="Glossary"></a> 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.
### <a name="Documentation"></a> Documentation:
#### <a name="Documentation-Overview"></a> Overview of methods of the class `\PhpZip\ZipFile`
- [ZipFile::__construct](#Documentation-ZipFile-__construct) - initializes the ZIP archive.
- [ZipFile::addAll](#Documentation-ZipFile-addAll) - adds all entries from an array.
- [ZipFile::addDir](#Documentation-ZipFile-addDir) - adds files to the archive from the directory on the specified path without subdirectories.
- [ZipFile::addDirRecursive](#Documentation-ZipFile-addDirRecursive) - adds files to the archive from the directory on the specified path with subdirectories.
- [ZipFile::addEmptyDir](#Documentation-ZipFile-addEmptyDir) - add a new directory.
- [ZipFile::addFile](#Documentation-ZipFile-addFile) - adds a file to a ZIP archive from the given path.
- [ZipFile::addSplFile](#Documentation-ZipFile-addSplFile) - adds a `\SplFileInfo` to a ZIP archive.
- [ZipFile::addFromFinder](#Documentation-ZipFile-addFromFinder) - adds files from the `Symfony\Component\Finder\Finder` to a ZIP archive.
- [ZipFile::addFilesFromIterator](#Documentation-ZipFile-addFilesFromIterator) - adds files from the iterator of directories.
- [ZipFile::addFilesFromGlob](#Documentation-ZipFile-addFilesFromGlob) - adds files from a directory by glob pattern without subdirectories.
- [ZipFile::addFilesFromGlobRecursive](#Documentation-ZipFile-addFilesFromGlobRecursive) - adds files from a directory by glob pattern with subdirectories.
- [ZipFile::addFilesFromRegex](#Documentation-ZipFile-addFilesFromRegex) - adds files from a directory by PCRE pattern without subdirectories.
- [ZipFile::addFilesFromRegexRecursive](#Documentation-ZipFile-addFilesFromRegexRecursive) - adds files from a directory by PCRE pattern with subdirectories.
- [ZipFile::addFromStream](#Documentation-ZipFile-addFromStream) - adds a entry from the stream to the ZIP archive.
- [ZipFile::addFromString](#Documentation-ZipFile-addFromString) - adds a file to a ZIP archive using its contents.
- [ZipFile::close](#Documentation-ZipFile-close) - close the archive.
- [ZipFile::count](#Documentation-ZipFile-count) - returns the number of entries in th
没有合适的资源?快使用搜索试试~ 我知道了~
亲测可用 开源Vue盲盒4.0源码 打包小程序app 网页盲盒源码
共8824个文件
php:2635个
js:2591个
png:1151个
2 下载量 138 浏览量
2023-05-16
19:03:11
上传
评论
收藏 394.7MB ZIP 举报
温馨提示
简单测试过了,没有什么大问题。 短信是对接的短信宝,也可以微信登录,支付可能要重新对接,可以接易支付。 没有授权,没有阉割全开源的版本,前端vue可以直接打包,也有教程,很详细。 有素材,搭建好以后只能可以运营
资源推荐
资源详情
资源评论
收起资源包目录
亲测可用 开源Vue盲盒4.0源码 打包小程序app 网页盲盒源码 (8824个子文件)
LICENSE-ASL-2.0 11KB
details.acss 15KB
camera.acss 10KB
invite.acss 6KB
index.acss 5KB
more.acss 4KB
show-result.acss 3KB
me.acss 3KB
search.acss 3KB
box.acss 2KB
myBox.acss 2KB
applyFaHuo.acss 2KB
server.acss 2KB
records.acss 2KB
payment.acss 2KB
hot.acss 2KB
recommend.acss 2KB
shai.acss 2KB
newBox.acss 2KB
order-details.acss 2KB
shopList.acss 2KB
balance.acss 2KB
recharge.acss 2KB
service.acss 2KB
main.acss 1KB
classify.acss 1KB
recycle.acss 1KB
phoneLogin.acss 1KB
goldDeposit.acss 1KB
deposit.acss 1KB
order.acss 1KB
login.acss 1KB
address.acss 1KB
wallet.acss 1KB
logistics.acss 1KB
addSite.acss 970B
forgetPassword.acss 914B
register.acss 914B
passwordRecharge.acss 867B
out.acss 817B
cashPay.acss 771B
bindPhone.acss 748B
set.acss 693B
coll.acss 657B
v-tabs.acss 611B
goods-detail.acss 562B
record.acss 544B
uni-popup.acss 445B
carpassList.acss 407B
WeChat.acss 312B
alipay.acss 312B
index.acss 276B
bannerMessage.acss 44B
wfsm.acss 42B
app.acss 31B
.addonrc 22KB
.addonrc 877B
.addonrc 593B
.addonrc 472B
.addonrc 98B
.addonrc 98B
__UNI__5F506A4__20220105203743.apk 27.75MB
__UNI__5F506A4__20220105203239.apk 27.75MB
__UNI__5F506A4_cm.apk 10.13MB
apkurl 77B
random_compat.phar.pubkey.asc 499B
details.axml 10KB
camera.axml 7KB
index.axml 5KB
invite.axml 4KB
box.axml 3KB
myBox.axml 3KB
more.axml 3KB
login.axml 3KB
wxParseTemplate0.axml 2KB
applyFaHuo.axml 2KB
addSite.axml 2KB
order-details.axml 2KB
search.axml 2KB
wxParseTemplate1.axml 2KB
wxParseTemplate5.axml 2KB
wxParseTemplate8.axml 2KB
wxParseTemplate2.axml 2KB
wxParseTemplate9.axml 2KB
wxParseTemplate4.axml 2KB
wxParseTemplate10.axml 2KB
wxParseTemplate6.axml 2KB
wxParseTemplate3.axml 2KB
wxParseTemplate7.axml 2KB
payment.axml 2KB
show-result.axml 2KB
me.axml 2KB
register.axml 2KB
v-tabs.axml 2KB
forgetPassword.axml 2KB
service.axml 1KB
deposit.axml 1KB
goldDeposit.axml 1KB
wxParseTemplate11.axml 1KB
recharge.axml 1KB
共 8824 条
- 1
- 2
- 3
- 4
- 5
- 6
- 89
资源评论
执刀人的工具库
- 粉丝: 1460
- 资源: 1610
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 旅游景点导游平台系统源代码.zip
- 美发门店管理系统项目源代码.zip
- 智能插座,个人学习整理,仅供参考
- 医院管理系统源代码.zip
- 西门子-大型堆垛机程序 真实运行案例 物流仓储 涵盖通信,算法,运动控制 实际项目程序 西门子S7-300+G120+ET200S 博途编程 采用用STL和SCL高级编程语言 无加密 仿
- 校园资源库系统源代码.zip
- 洗衣店管理系统项目源代码.zip
- 医院网站源代码.zip
- MPC5634 Bootloader
- 前后端分离的在线办公系统,项目采用 SpringBoot+Uniapp 开发,前端采用微信小程序展示.zip
- GitHub 搜索技巧与高级用法详解
- 威纶通触摸屏与三菱变频器modbus rtu通讯程序 触摸屏型号mt6103ip,变频器型号FR-D720(E700系列也可以用)
- HFSS创建SG模型的端口设置
- 微信小程序源码养老院管理系统(小程序)pf-毕业设计.zip
- 胶钉机程序 用国产三菱3U和威纶触摸屏编写 此程序已经实际设备上批量应用,程序成熟可靠,借鉴价值高,程序有注释
- 微机原理试卷及答案.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功