`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 the archive.
- [ZipFile::deleteFromName](#Documentation-ZipFile-deleteFromName) - deletes an entry in the archive using its name.
没有合适的资源?快使用搜索试试~ 我知道了~
源支付3.1版本全开源版+店员监控软件+手机监控APP源码
共10784个文件
php:3984个
js:2631个
less:526个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 181 浏览量
2022-07-04
12:17:41
上传
评论 1
收藏 271.89MB ZIP 举报
温馨提示
效果图:https://ccc.huinenglingdong.top/?type=productinfo&id 源码介绍: PHP7.2 Mysql5.6 Supervisor管理器 Redis 1.新建一个网站,解压,环境选择PHP7.2 网站运行目录public 伪静态选择thinkphp 2.安装完网站后打开终端,执行以下命令 sudo rpm -Uvh https://packages.microsoft.com/c ... -microsoft-prod.rpm sudo yum install dotnet-sdk-3.1 遇到需要输入的时候全部输入y 3.安装完毕,打开搭建的网站,打开CloudAPI文件找到appssettings.json,将里面的数据库信息改为刚刚搭建的网站的 4.修改完毕保存,启动进程,目录选择这个CloudAPI目录,启动命令为:dotnet KaleCloud.Web.dll 5.此时没有win服务器,演示一下Linux搭建步骤,稍后会单独简单演示一下win的搭建 1.先创建一个目录,上传源码,解压后我们的环境刚刚安装了,删除掉就可以,这
资源推荐
资源详情
资源评论
收起资源包目录
源支付3.1版本全开源版+店员监控软件+手机监控APP源码 (10784个子文件)
.addonrc 2KB
.addonrc 1KB
.addonrc 1KB
.addonrc 1017B
.addonrc 878B
.addonrc 856B
.addonrc 745B
.addonrc 593B
.addonrc 592B
.addonrc 503B
.addonrc 118B
.addonrc 100B
.addonrc 100B
.addonrc 98B
.addonrc 98B
__UNI__8A8301C_cm.apk 21.77MB
apkurl 77B
random_compat.phar.pubkey.asc 488B
random_compat.phar.pubkey.asc 488B
gnt.bat 10KB
msbuild.bat 1KB
powershell.bat 451B
nsbin.bat 223B
.bowerrc 162B
pimple.c 37KB
pimple.c 37KB
spin100_IR_SDK.csprojAssemblyReference.cache 29KB
spin100_IR_SDK.csprojAssemblyReference.cache 29KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
YuanPay.csproj.GenerateResource.cache 1015B
spin100_IR_SDK.csproj.GenerateResource.cache 942B
NiLiuShui.IRQQ.CSharp.csproj.GenerateResource.cache 942B
spin100_QQLight_SDK.csproj.GenerateResource.cache 942B
spin100_Keaimao_SDK.csproj.GenerateResource.cache 942B
spin100_IR_SDK.csproj.GenerateResource.cache 942B
DesignTimeResolveAssemblyReferences.cache 932B
spin100_Keaimao_SDK.csproj.AssemblyReference.cache 290B
spin100_Keaimao_SDK.csproj.Fody.CopyLocal.cache 165B
YuanPay.csproj.Fody.CopyLocal.cache 99B
spin100_Keaimao_SDK.csproj.CoreCompileInputs.cache 42B
YuanPay.csproj.CoreCompileInputs.cache 42B
CoreCompileInputs.cache 41B
spin100_IR_SDK.csproj.CoreCompileInputs.cache 41B
spin100_QQLight_SDK.csproj.CoreCompileInputs.cache 41B
spin100_IR_SDK.csproj.CoreCompileInputs.cache 41B
CoreCompileInputs.cache 41B
NiLiuShui.IRQQ.CSharp.csproj.CoreCompileInputs.cache 41B
certdata 153B
certini 113B
CHANGELOG 1KB
CHANGELOG 1KB
9C79B6FBF85B8B87DD781B20FC38BA2AC0664143.costura.newtonsoft.json.dll.compressed 210KB
8384113BFB9BFA6B10EE2BD62D53DC36C7EC506E.costura.costura.dll.compressed 2KB
packages.config 375B
config 322B
config 322B
config 293B
config 293B
config 280B
config 280B
config 263B
config 263B
config 263B
config 263B
config 252B
config 252B
config 247B
config 247B
config 241B
config 241B
config 241B
config 241B
config 239B
config 239B
config 239B
config 239B
config 238B
config 238B
config 238B
config 238B
config 237B
config 237B
config 237B
config 237B
config 236B
config 236B
config 235B
config 235B
config 71B
config 71B
spin100_IR_SDK.csproj.CopyComplete 0B
YuanPay.csproj.CopyComplete 0B
spin100_Keaimao_SDK.csproj.CopyComplete 0B
spin100_QQLight_SDK.csproj.CopyComplete 0B
alipayCertPublicKey.crt 0B
appCertPublicKey.crt 0B
alipayRootCert.crt 0B
HttpHelper.cs 29KB
API.cs 24KB
共 10784 条
- 1
- 2
- 3
- 4
- 5
- 6
- 108
资源评论
零物购
- 粉丝: 24
- 资源: 316
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功