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