// --------------------------------------------------------------------------------
// PclZip 2.8.2 - readme.txt
// --------------------------------------------------------------------------------
// License GNU/LGPL - August 2009
// Vincent Blavet - vincent@phpconcept.net
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $
// --------------------------------------------------------------------------------
0 - Sommaire
============
1 - Introduction
2 - What's new
3 - Corrected bugs
4 - Known bugs or limitations
5 - License
6 - Warning
7 - Documentation
8 - Author
9 - Contribute
1 - Introduction
================
PclZip is a library that allow you to manage a Zip archive.
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
2 - What's new
==============
Version 2.8.2 :
- PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with
extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string
can also be modified in the post-extract call back.
**Bugs correction :
- PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly
- Remove use of eval() and do direct call to callback functions
- Correct support of 64bits systems (Thanks to WordPress team)
Version 2.8.1 :
- Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
automatically replace it by PCLZIP_OPT_BY_PREG.
Version 2.8 :
- Improve extraction of zip archive for large files by using temporary files
This feature is working like the one defined in r2.7.
Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
PCLZIP_OPT_TEMP_FILE_THRESHOLD
- Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
sense of temporary file use.
- Bug correction : Reduce filepath in returned file list to remove ennoying
'.//' preambule in file path.
Version 2.7 :
- Improve creation of zip archive for large files :
PclZip will now autosense the configured memory and use temporary files
when large file is suspected.
This feature can also ne triggered by manual options in create() and add()
methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
threshold to use temporary files.
Using "temporary files" rather than "memory" might take more time, but
might give the ability to zip very large files :
Tested on my win laptop with a 88Mo file :
Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
- Replace use of mktime() by time() to limit the E_STRICT error messages.
- Bug correction : When adding files with full windows path (drive letter)
PclZip is now working. Before, if the drive letter is not the default
path, PclZip was not able to add the file.
Version 2.6 :
- Code optimisation
- New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
add a comment for a specific file. (Don't really know if this is usefull)
- New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
as a file.
- New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
a file.
- Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
with current time
- Add CRC value in the informations returned back for each file after an
action.
- Add missing closedir() statement.
- When adding a folder, and removing the path of this folder, files were
incorrectly added with a '/' at the beginning. Which means files are
related to root in unix systems. Corrected.
- Add conditional if before constant definition. This will allow users
to redefine constants without changing the file, and then improve
upgrade of pclzip code for new versions.
Version 2.5 :
- Introduce the ability to add file/folder with individual properties (file descriptor).
This gives for example the ability to change the filename of a zipped file.
. Able to add files individually
. Able to change full name
. Able to change short name
. Compatible with global options
- New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
- New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
- Add a security control feature. PclZip can extract any file in any folder
of a system. People may use this to upload a zip file and try to override
a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
ability to forgive any directory transversal behavior.
- New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
- New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
- Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
by current path (getcwd())
Version 2.4 :
- Code improvment : try to speed up the code by removing unusefull call to pack()
- Correct bug in delete() : delete() should be called with no argument. This was not
the case in 2.3. This is corrected in 2.4.
- Correct a bug in path_inclusion function. When the path has several '../../', the
result was bad.
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
disable it while working and det it back to its original value.
This resolve a lots of bad formated archive errors.
- Bug correction : PclZip now correctly unzip file in some specific situation,
when compressed content has same size as uncompressed content.
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
directories are not any more created.
- Code improvment : correct unclosed opendir(), better handling of . and .. in
loops.
Version 2.3 :
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
give the same result in PHP4 and PHP5 ....
Version 2.2 :
- Try development of PCLZIP_OPT_CRYPT .....
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
the result (greater than a long) is not supported by PHP. Even the use of bcmath
functions does not help. I did not find yet a solution ...;
- Add missing '/' at end of directory entries
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
- Corrected : Bad "version need to extract" field in local file header
- Add private method privCheckFileHeaders() in order to check local and central
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
the ability to have a local file header without size, compressed size and crc filled.
- Add a generic status 'error' for file status
- Add control of compression type. PclZip only support deflate compression method.
Before v2.2, PclZip does not check the compression method used in an archive while
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
compression method. New status is "unsupported_compression". New error code is
PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
when er
PHPExcel的导出和保存的包
需积分: 0 73 浏览量
更新于2023-02-16
收藏 2.72MB ZIP 举报
PHPExcel是一款广泛应用于PHP环境中的库,它允许开发者创建、读取和编辑Microsoft Office Excel文件,包括.xls和.xlsx格式。这个库提供了丰富的功能,使得在Web应用程序中处理和生成Excel文件变得简单易行。
1. **PHPExcel的基本概念**
PHPExcel库基于PHP语言,通过面向对象的编程方式提供了一个强大的API,可以用来操作Excel表格的数据和格式。它支持多种文件格式,如Biff (Excel 97-2003), XML (Excel 2003/2007), HTML, CSV, OpenDocument Spreadsheet等。
2. **导出Excel文件**
使用PHPExcel,你可以创建新的Excel工作簿,添加工作表,插入数据,设置单元格样式,公式,以及图表。例如,你可以创建一个新工作簿,然后逐行添加数据,最后调用save方法将数据导出为Excel文件。
3. **保存Excel文件**
PHPExcel不仅支持新建Excel文件,还能够读取现有文件并进行修改后再保存。读取文件时,你可以选择打开指定的Excel文件,然后对其中的数据进行修改,比如更新单元格值、调整样式或者添加新的工作表。修改完成后,使用`save()`或`write()`方法将更改保存回文件。
4. **格式与样式**
PHPExcel提供了丰富的样式设置,包括字体、颜色、边框、填充、对齐方式、条件格式等。你可以自定义单元格的样式,或者创建样式模板,方便多次使用。
5. **公式与函数**
PHPExcel支持Excel的内置公式和函数,你可以直接在单元格中插入公式,如SUM、AVERAGE、IF等,系统会自动计算结果。
6. **性能优化**
大量数据处理时,PHPExcel可能会消耗大量内存。为优化性能,可以使用内存优化技巧,如分批写入数据,或者使用CSV格式代替Excel来减少内存占用。
7. **错误处理与异常**
在使用PHPExcel时,可能会遇到各种错误,如文件不存在、格式不正确、内存不足等。PHPExcel提供了一套完善的异常处理机制,可以通过捕获异常来处理这些问题。
8. **版本兼容性**
虽然PHPExcel在处理Excel 2007 (.xlsx)格式上表现出色,但它同样支持旧版Excel文件格式(.xls),这使得它能覆盖更广泛的用户群体。
9. **与其他库的集成**
PHPExcel可以与现有的PHP框架如Laravel、Yii等无缝集成,方便在大型项目中使用。
10. **示例代码**
创建一个简单的Excel文件并保存的代码如下:
```php
require_once 'PHPExcel.php';
$objPHPExcel = new PHPExcel();
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Hello');
$objPHPExcel->getActiveSheet()->setCellValue('B2', 'World!');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('helloWorld.xlsx');
```
PHPExcel是一个强大且灵活的工具,它使PHP开发者能够方便地生成和处理Excel文件,适用于各种需要批量数据处理或报告生成的场景。不过,需要注意的是,由于PHPExcel的维护已经停止,对于新的项目,开发者可能需要考虑使用其他替代库,如Spout或PhpSpreadsheet。
顺其自然~
- 粉丝: 24
- 资源: 5
最新资源
- 多目标点移动机器人改进路径规划算法 送餐机器人,AGV室内机器人仿真路径规划 采用改进A*算法融合模拟 火算法,规划多目标点路径规划 解决路径与障碍物相撞,AGV不斜穿室内区间,采用水平垂直方向移动
- 基于C#语言的上海水电服务端及MQTT服务端设计源码
- 基于carsim与matlab simulink的联合仿真,采用五次多项式实时规划,控制量为节气门开度,制动压力与方向盘转角,弯道道模型
- 动态加载dll控制软件框架,可自主根据接口扩展dll,配置到主框架运行 开发语言:C# + Halcon 1.运动控制,相机采图; 2.实时加载dll工具流程,动态加载窗口; 3.IO控制获取工
- 基于PHP、JavaScript、CSS、HTML、Shell语言的芊雅自助台球系统设计源码
- 基于微信小程序技术的书店门户全功能设计源码
- 表贴式永磁同步电机非线性磁链观测器无感仿真,该仿真在初始位置确定后能够直接起动电机,在低速区不需要高频信号注入,起动电流远远小于if起动,转速和位置在速度上来后精度高,即使在低速也有不错的性能 起动
- 基于Vue框架的新闻资讯与商城前后端分离项目设计源码
- 前端分析-2023071100789
- 基于hyperf框架的全新Vue3+Antdv2.1后台管理系统设计源码
- factoryio工厂流水线仿真程序 使用简单的梯形图与SCL语言编写,通俗易懂,起到抛砖引玉的作用,比较适合有动手能力的入门初学者 软件环境: 1、西门子编程软件:TIA Portal V15(博
- 基于Go语言的secpaver安全策略开发工具源码
- 西门子PCS7自定义单位教程 1.西门子PCS7非标单位的程序编写: 例如:% LEL,%VOL 2.自定义的单位如何立即生效 3.在CFC中通道输入和输出块的单位引脚,直接指定自定义单位,WIN
- 基于TypeScript开发的鸿蒙操作系统录音机设计源码
- 基于Vue框架的慕课在线教育平台设计源码
- 非线性振动,非线性动力学分岔,混沌