| 1 |
// -------------------------------------------------------------------------------- |
|---|
| 2 |
// PclZip 2.4 - readme.txt |
|---|
| 3 |
// -------------------------------------------------------------------------------- |
|---|
| 4 |
// License GNU/LGPL - November 2004 |
|---|
| 5 |
// Vincent Blavet - vincent@phpconcept.net |
|---|
| 6 |
// http://www.phpconcept.net |
|---|
| 7 |
// -------------------------------------------------------------------------------- |
|---|
| 8 |
// $Id: readme.txt,v 1.6 2005/10/15 09:58:36 stronk7 Exp $ |
|---|
| 9 |
// -------------------------------------------------------------------------------- |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
0 - Sommaire |
|---|
| 14 |
============ |
|---|
| 15 |
1 - Introduction |
|---|
| 16 |
2 - What's new |
|---|
| 17 |
3 - Corrected bugs |
|---|
| 18 |
4 - Known bugs or limitations |
|---|
| 19 |
5 - License |
|---|
| 20 |
6 - Warning |
|---|
| 21 |
7 - Author |
|---|
| 22 |
8 - Contribute |
|---|
| 23 |
|
|---|
| 24 |
1 - Introduction |
|---|
| 25 |
================ |
|---|
| 26 |
|
|---|
| 27 |
PclZip is a library that allow you to manage a Zip archive. |
|---|
| 28 |
|
|---|
| 29 |
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip |
|---|
| 30 |
|
|---|
| 31 |
2 - What's new |
|---|
| 32 |
============== |
|---|
| 33 |
|
|---|
| 34 |
Version 2.4 : |
|---|
| 35 |
- Code improvment : try to speed up the code by removing unusefull call to pack() |
|---|
| 36 |
- Correct bug in delete() : delete() should be called with no argument. This was not |
|---|
| 37 |
the case in 2.3. This is corrected in 2.4. |
|---|
| 38 |
- Correct a bug in path_inclusion function. When the path has several '../../', the |
|---|
| 39 |
result was bad. |
|---|
| 40 |
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will |
|---|
| 41 |
disable it while working and det it back to its original value. |
|---|
| 42 |
This resolve a lots of bad formated archive errors. |
|---|
| 43 |
- Bug correction : PclZip now correctly unzip file in some specific situation, |
|---|
| 44 |
when compressed content has same size as uncompressed content. |
|---|
| 45 |
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', |
|---|
| 46 |
directories are not any more created. |
|---|
| 47 |
- Code improvment : correct unclosed opendir(), better handling of . and .. in |
|---|
| 48 |
loops. |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
Version 2.3 : |
|---|
| 52 |
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not |
|---|
| 53 |
give the same result in PHP4 and PHP5 .... |
|---|
| 54 |
|
|---|
| 55 |
Version 2.2 : |
|---|
| 56 |
- Try development of PCLZIP_OPT_CRYPT ..... |
|---|
| 57 |
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, |
|---|
| 58 |
the result (greater than a long) is not supported by PHP. Even the use of bcmath |
|---|
| 59 |
functions does not help. I did not find yet a solution ...; |
|---|
| 60 |
- Add missing '/' at end of directory entries |
|---|
| 61 |
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or |
|---|
| 62 |
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. |
|---|
| 63 |
- Corrected : Bad "version need to extract" field in local file header |
|---|
| 64 |
- Add private method privCheckFileHeaders() in order to check local and central |
|---|
| 65 |
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives |
|---|
| 66 |
the ability to have a local file header without size, compressed size and crc filled. |
|---|
| 67 |
- Add a generic status 'error' for file status |
|---|
| 68 |
- Add control of compression type. PclZip only support deflate compression method. |
|---|
| 69 |
Before v2.2, PclZip does not check the compression method used in an archive while |
|---|
| 70 |
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported |
|---|
| 71 |
compression method. New status is "unsupported_compression". New error code is |
|---|
| 72 |
PCLZIP_ERR_UNSUPPORTED_COMPRESSION. |
|---|
| 73 |
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files |
|---|
| 74 |
when errors like 'a folder with same name exists' or 'a newer file exists' or |
|---|
| 75 |
'a write protected file' exists, rather than set a status for the concerning file |
|---|
| 76 |
and resume the extract of the zip. |
|---|
| 77 |
- Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the |
|---|
| 78 |
replacement of the file, even if a newer version of the file exists. |
|---|
| 79 |
Note that today if a file with the same name already exists but is older it will be |
|---|
| 80 |
replaced by the extracted one. |
|---|
| 81 |
- Improve PclZipUtilOption() |
|---|
| 82 |
- Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central |
|---|
| 83 |
directory structure is the last data in the archive. Crypt encryption/decryption of |
|---|
| 84 |
zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. |
|---|
| 85 |
|
|---|
| 86 |
Version 2.1 : |
|---|
| 87 |
- Add the ability to abort the extraction by using a user callback function. |
|---|
| 88 |
The user can now return the value '2' in its callback which indicates to stop the |
|---|
| 89 |
extraction. For a pre call-back extract is stopped before the extration of the current |
|---|
| 90 |
file. For a post call back, the extraction is stopped after. |
|---|
| 91 |
- Add the ability to extract a file (or several files) directly in the standard output. |
|---|
| 92 |
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). |
|---|
| 93 |
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, |
|---|
| 94 |
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments |
|---|
| 95 |
in the zip archive. |
|---|
| 96 |
- When merging two archives, the comments are not any more lost, but merged, with a |
|---|
| 97 |
blank space separator. |
|---|
| 98 |
- Corrected bug : Files are not deleted when all files are asked to be deleted. |
|---|
| 99 |
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
Version 2.0 : |
|---|
| 103 |
***** Warning : Some new features may break the backward compatibility for your scripts. |
|---|
| 104 |
Please carefully read the readme file. |
|---|
| 105 |
- Add the ability to delete by Index, name and regular expression. This feature is |
|---|
| 106 |
performed by the method delete(), which uses the optional parameters |
|---|
| 107 |
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. |
|---|
| 108 |
- Add the ability to extract by regular expression. To extract by regexp you must use the method |
|---|
| 109 |
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG |
|---|
| 110 |
(depending if you want to use ereg() or preg_match() syntax) followed by the |
|---|
| 111 |
regular expression pattern. |
|---|
| 112 |
- Add the ability to extract by index, directly with the extract() method. This is a |
|---|
| 113 |
code improvment of the extractByIndex() method. |
|---|
| 114 |
- Add the ability to extract by name. To extract by name you must use the method |
|---|
| 115 |
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to |
|---|
| 116 |
extract or an array of filenames to extract. To extract all a folder, use the folder |
|---|
| 117 |
name rather than the filename with a '/' at the end. |
|---|
| 118 |
- Add the ability to add files without compression. This is done with a new attribute |
|---|
| 119 |
which is PCLZIP_OPT_NO_COMPRESSION. |
|---|
| 120 |
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly |
|---|
| 121 |
in a string without using any file (or temporary file). |
|---|
| 122 |
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. |
|---|
| 123 |
The default separator is now a comma (,) and not any more a blank space. |
|---|
| 124 |
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with |
|---|
| 125 |
your script. |
|---|
| 126 |
- Improve algorythm performance by removing the use of temporary files when adding or |
|---|
| 127 |
extracting files in an archive. |
|---|
| 128 |
- Add (correct) detection of empty filename zipping. This can occurs when the removed |
|---|
| 129 |
path is the same |
|---|
| 130 |
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. |
|---|
| 131 |
- Add better support for windows paths (thanks for help from manus@manusfreedom.com). |
|---|
| 132 |
- Corrected bug : When the archive file already exists with size=0, the add() method |
|---|
| 133 |
fails. Corrected in 2.0. |
|---|
| 134 |
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather. |
|---|
| 135 |
- Control the order of index ranges in extract by index feature. |
|---|
| 136 |
- Change the internal management of folders (better handling of internal flag). |
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
Version 1.3 : |
|---|
| 140 |
- Removing the double include check. This is now done by include_once() and require_once() |
|---|
| 141 |
PHP directives. |
|---|
| 142 |
- Changing the error handling mecanism : Remove the use of an external error library. |
|---|
| 143 |
The former PclError...() functions are replaced by internal equivalent methods. |
|---|
| 144 |
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. |
|---|
| 145 |
Introducing the use of constants for error codes rather than integer values. This will help |
|---|
| 146 |
in futur improvment. |
|---|
| 147 |
Introduction of error handling functions like errorCode(), errorName() and errorInfo(). |
|---|
| 148 |
- Remove the deprecated use of calling function with arguments passed by reference. |
|---|
| 149 |
- Add the calling of extract(), extractByIndex(), create() and add() functions |
|---|
| 150 |
with variable options rather than fixed arguments. |
|---|
| 151 |
- Add the ability to remove all the file path while extracting or adding, |
|---|
| 152 |
without any need to specify the path to remove. |
|---|
| 153 |
This is available for extract(), extractByIndex(), create() and add() functionS by using |
|---|
| 154 |
the new variable options parameters : |
|---|
| 155 |
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. |
|---|
| 156 |
- Ability to change the mode of a file after the extraction (chmod()). |
|---|
| 157 |
This is available for extract() and extractByIndex() functionS by using |
|---|
| 158 |
the new variable options parameters. |
|---|
| 159 |
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option. |
|---|
| 160 |
- Ability to definition call-back options. These call-back will be called during the adding, |
|---|
| 161 |
or the extracting of file (extract(), extractByIndex(), create() and add() functions) : |
|---|
| 162 |
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user |
|---|
| 163 |
can trigerred the change the filename of the extracted file. The user can triggered the |
|---|
| 164 |
skip of the extraction. This is adding a 'skipped' status in the file list result value. |
|---|
| 165 |
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. |
|---|
| 166 |
Nothing can be triggered from that point. |
|---|
| 167 |
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user |
|---|
| 168 |
can trigerred the change the stored filename of the added file. The user can triggered the |
|---|
| 169 |
skip of the add. This is adding a 'skipped' status in the file list result value. |
|---|
| 170 |
- PCLZIP_CB_POST_ADD : will be called after each add of a file. |
|---|
| 171 |
Nothing can be triggered from that point. |
|---|
| 172 |
- Two status are added in the file list returned as function result : skipped & filename_too_long |
|---|
| 173 |
'skipped' is used when a call-back function ask for skipping the file. |
|---|
| 174 |
'filename_too_long' is used while adding a file with a too long filename to archive (the file is |
|---|
| 175 |
not added) |
|---|
| 176 |
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into |
|---|
| 177 |
a directory. |
|---|
| 178 |
- Add a check of the presence of the archive file before some actions (like list, ...) |
|---|
| 179 |
- Add the initialisation of field "index" in header array. This means that by |
|---|
| 180 |
default index will be -1 when not explicitly set by the methods. |
|---|
| 181 |
|
|---|
| 182 |
Version 1.2 : |
|---|
| 183 |
- Adding a duplicate function. |
|---|
| 184 |
- Adding a merge function. The merge function is a "quick merge" function, |
|---|
| 185 |
it just append the content of an archive at the end of the first one. There |
|---|
| 186 |
is no check for duplicate files or more recent files. |
|---|
| 187 |
- Improve the search of the central directory end. |
|---|
| 188 |
|
|---|
| 189 |
Version 1.1.2 : |
|---|
| 190 |
|
|---|
| 191 |
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license |
|---|
| 192 |
(see License section). |
|---|
| 193 |
- Adding the optional support of a static temporary directory. You will need to configure |
|---|
| 194 |
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. |
|---|
| 195 |
- Improving the rename() function. In some cases rename() does not work (different |
|---|
| 196 |
Filesystems), so it will be replaced by a copy() + unlink() functions. |
|---|
| 197 |
|
|---|
| 198 |
Version 1.1.1 : |
|---|
| 199 |
|
|---|
| 200 |
- Maintenance release, no new feature. |
|---|
| 201 |
|
|---|
| 202 |
Version 1.1 : |
|---|
| 203 |
|
|---|
| 204 |
- New method Add() : adding files in the archive |
|---|
| 205 |
- New method ExtractByIndex() : partial extract of the archive, files are identified by |
|---|
| 206 |
their index in the archive |
|---|
| 207 |
- New method DeleteByIndex() : delete some files/folder entries from the archive, |
|---|
| 208 |
files are identified by their index in the archive. |
|---|
| 209 |
- Adding a test of the zlib extension presence. If not present abort the script. |
|---|
| 210 |
|
|---|
| 211 |
Version 1.0.1 : |
|---|
| 212 |
|
|---|
| 213 |
- No new feature |
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
3 - Corrected bugs |
|---|
| 217 |
================== |
|---|
| 218 |
|
|---|
| 219 |
Corrected in Version 2.0 : |
|---|
| 220 |
- Corrected : During an extraction, if a call-back fucntion is used and try to skip |
|---|
| 221 |
a file, all the extraction process is stopped. |
|---|
| 222 |
|
|---|
| 223 |
Corrected in Version 1.3 : |
|---|
| 224 |
- Corrected : Support of static synopsis for method extract() is broken. |
|---|
| 225 |
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). |
|---|
| 226 |
- Corrected : When an extract is done with a remove_path parameter, the entry for |
|---|
| 227 |
the directory with exactly the same path is not skipped/filtered. |
|---|
| 228 |
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the |
|---|
| 229 |
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This |
|---|
| 230 |
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on |
|---|
| 231 |
string and not interger). The sort is temporarilly removed, this means that |
|---|
| 232 |
you must provide a sorted list of index ranges. |
|---|
| 233 |
|
|---|
| 234 |
Corrected in Version 1.2 : |
|---|
| 235 |
|
|---|
| 236 |
- Nothing. |
|---|
| 237 |
|
|---|
| 238 |
Corrected in Version 1.1.2 : |
|---|
| 239 |
|
|---|
| 240 |
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives. |
|---|
| 241 |
|
|---|
| 242 |
Corrected in Version 1.1.1 : |
|---|
| 243 |
|
|---|
| 244 |
- Corrected : When archived file is not compressed (0% compression), the |
|---|
| 245 |
extract method fails. |
|---|
| 246 |
|
|---|
| 247 |
Corrected in Version 1.1 : |
|---|
| 248 |
|
|---|
| 249 |
- Corrected : Adding a complete tree of folder may result in a bad archive |
|---|
| 250 |
creation. |
|---|
| 251 |
|
|---|
| 252 |
Corrected in Version 1.0.1 : |
|---|
| 253 |
|
|---|
| 254 |
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). |
|---|
| 255 |
|
|---|
| 256 |
|
|---|
| 257 |
4 - Known bugs or limitations |
|---|
| 258 |
============================= |
|---|
| 259 |
|
|---|
| 260 |
Please publish bugs reports in SourceForge : |
|---|
| 261 |
http://sourceforge.net/tracker/?group_id=40254&atid=427564 |
|---|
| 262 |
|
|---|
| 263 |
In Version 2.x : |
|---|
| 264 |
- PclZip does only support file uncompressed or compressed with deflate (compression method 8) |
|---|
| 265 |
- PclZip does not support password protected zip archive |
|---|
| 266 |
|
|---|
| 267 |
In Version 1.2 : |
|---|
| 268 |
|
|---|
| 269 |
- merge() methods does not check for duplicate files or last date of modifications. |
|---|
| 270 |
|
|---|
| 271 |
In Version 1.1 : |
|---|
| 272 |
|
|---|
| 273 |
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported. |
|---|
| 274 |
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to |
|---|
| 275 |
add a file in a PclZip created archive. (Corrected in v.1.2) |
|---|
| 276 |
|
|---|
| 277 |
In Version 1.0.1 : |
|---|
| 278 |
|
|---|
| 279 |
- Adding a complete tree of folder may result in a bad archive |
|---|
| 280 |
creation. (Corrected in V.1.1). |
|---|
| 281 |
- Path given to methods must be in the unix format (/) and not the Windows format (\). |
|---|
| 282 |
Workaround : Use only / directory separators. |
|---|
| 283 |
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz |
|---|
| 284 |
added suffix. Files with these names may already exist and may be overwritten. |
|---|
| 285 |
Workaround : none. |
|---|
| 286 |
- PclZip does not check if the zlib extension is present. If it is absent, the zip |
|---|
| 287 |
file is not created and the lib abort without warning. |
|---|
| 288 |
Workaround : enable the zlib extension on the php install |
|---|
| 289 |
|
|---|
| 290 |
In Version 1.0 : |
|---|
| 291 |
|
|---|
| 292 |
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). |
|---|
| 293 |
(Corrected in v.1.0.1) |
|---|
| 294 |
- Limitation : Multi-disk zip archive are not supported. |
|---|
| 295 |
|
|---|
| 296 |
|
|---|
| 297 |
5 - License |
|---|
| 298 |
=========== |
|---|
| 299 |
|
|---|
| 300 |
Since version 1.1.2, PclZip Library is released under GNU/LGPL license. |
|---|
| 301 |
This library is free, so you can use it at no cost. |
|---|
| 302 |
|
|---|
| 303 |
HOWEVER, if you release a script, an application, a library or any kind of |
|---|
| 304 |
code using PclZip library (or a part of it), YOU MUST : |
|---|
| 305 |
- Indicate in the documentation (or a readme file), that your work |
|---|
| 306 |
uses PclZip Library, and make a reference to the author and the web site |
|---|
| 307 |
http://www.phpconcept.net |
|---|
| 308 |
- Gives the ability to the final user to update the PclZip libary. |
|---|
| 309 |
|
|---|
| 310 |
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to |
|---|
| 311 |
be aware that someone is using PclZip. |
|---|
| 312 |
|
|---|
| 313 |
For more information about GNU/LGPL license : http://www.gnu.org |
|---|
| 314 |
|
|---|
| 315 |
6 - Warning |
|---|
| 316 |
================= |
|---|
| 317 |
|
|---|
| 318 |
This library and the associated files are non commercial, non professional work. |
|---|
| 319 |
It should not have unexpected results. However if any damage is caused by this software |
|---|
| 320 |
the author can not be responsible. |
|---|
| 321 |
The use of this software is at the risk of the user. |
|---|
| 322 |
|
|---|
| 323 |
7 - Author |
|---|
| 324 |
========== |
|---|
| 325 |
|
|---|
| 326 |
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. |
|---|
| 327 |
|
|---|
| 328 |
8 - Contribute |
|---|
| 329 |
============== |
|---|
| 330 |
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. |
|---|
| 331 |
If you can help in financing PhpConcept hosting service, please go to |
|---|
| 332 |
http://www.phpconcept.net/soutien.php |
|---|