1 |
317
|
stefan
|
// --------------------------------------------------------------------------------
|
2 |
|
|
// PclZip 2.1 - readme.txt
|
3 |
|
|
// --------------------------------------------------------------------------------
|
4 |
|
|
// License GNU/LGPL - December 2003
|
5 |
|
|
// Vincent Blavet - vincent@phpconcept.net
|
6 |
|
|
// http://www.phpconcept.net
|
7 |
|
|
// --------------------------------------------------------------------------------
|
8 |
|
|
// $Id: readme.txt,v 1.1.1.1 2005/01/30 10:31:46 rdjurovich 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.1 :
|
35 |
|
|
- Add the ability to abort the extraction by using a user callback function.
|
36 |
|
|
The user can now return the value '2' in its callback which indicates to stop the
|
37 |
|
|
extraction. For a pre call-back extract is stopped before the extration of the current
|
38 |
|
|
file. For a post call back, the extraction is stopped after.
|
39 |
|
|
- Add the ability to extract a file (or several files) directly in the standard output.
|
40 |
|
|
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
|
41 |
|
|
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
|
42 |
|
|
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
|
43 |
|
|
in the zip archive.
|
44 |
|
|
- When merging two archives, the comments are not any more lost, but merged, with a
|
45 |
|
|
blank space separator.
|
46 |
|
|
- Corrected bug : Files are not deleted when all files are asked to be deleted.
|
47 |
|
|
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
Version 2.0 :
|
51 |
|
|
***** Warning : Some new features may break the backward compatibility for your scripts.
|
52 |
|
|
Please carefully read the readme file.
|
53 |
|
|
- Add the ability to delete by Index, name and regular expression. This feature is
|
54 |
|
|
performed by the method delete(), which uses the optional parameters
|
55 |
|
|
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
|
56 |
|
|
- Add the ability to extract by regular expression. To extract by regexp you must use the method
|
57 |
|
|
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
|
58 |
|
|
(depending if you want to use ereg() or preg_match() syntax) followed by the
|
59 |
|
|
regular expression pattern.
|
60 |
|
|
- Add the ability to extract by index, directly with the extract() method. This is a
|
61 |
|
|
code improvment of the extractByIndex() method.
|
62 |
|
|
- Add the ability to extract by name. To extract by name you must use the method
|
63 |
|
|
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
|
64 |
|
|
extract or an array of filenames to extract. To extract all a folder, use the folder
|
65 |
|
|
name rather than the filename with a '/' at the end.
|
66 |
|
|
- Add the ability to add files without compression. This is done with a new attribute
|
67 |
|
|
which is PCLZIP_OPT_NO_COMPRESSION.
|
68 |
|
|
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
|
69 |
|
|
in a string without using any file (or temporary file).
|
70 |
|
|
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
|
71 |
|
|
The default separator is now a comma (,) and not any more a blank space.
|
72 |
|
|
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
|
73 |
|
|
your script.
|
74 |
|
|
- Improve algorythm performance by removing the use of temporary files when adding or
|
75 |
|
|
extracting files in an archive.
|
76 |
|
|
- Add (correct) detection of empty filename zipping. This can occurs when the removed
|
77 |
|
|
path is the same
|
78 |
|
|
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
|
79 |
|
|
- Add better support for windows paths (thanks for help from manus@manusfreedom.com).
|
80 |
|
|
- Corrected bug : When the archive file already exists with size=0, the add() method
|
81 |
|
|
fails. Corrected in 2.0.
|
82 |
|
|
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
|
83 |
|
|
- Control the order of index ranges in extract by index feature.
|
84 |
|
|
- Change the internal management of folders (better handling of internal flag).
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
Version 1.3 :
|
88 |
|
|
- Removing the double include check. This is now done by include_once() and require_once()
|
89 |
|
|
PHP directives.
|
90 |
|
|
- Changing the error handling mecanism : Remove the use of an external error library.
|
91 |
|
|
The former PclError...() functions are replaced by internal equivalent methods.
|
92 |
|
|
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
|
93 |
|
|
Introducing the use of constants for error codes rather than integer values. This will help
|
94 |
|
|
in futur improvment.
|
95 |
|
|
Introduction of error handling functions like errorCode(), errorName() and errorInfo().
|
96 |
|
|
- Remove the deprecated use of calling function with arguments passed by reference.
|
97 |
|
|
- Add the calling of extract(), extractByIndex(), create() and add() functions
|
98 |
|
|
with variable options rather than fixed arguments.
|
99 |
|
|
- Add the ability to remove all the file path while extracting or adding,
|
100 |
|
|
without any need to specify the path to remove.
|
101 |
|
|
This is available for extract(), extractByIndex(), create() and add() functionS by using
|
102 |
|
|
the new variable options parameters :
|
103 |
|
|
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
|
104 |
|
|
- Ability to change the mode of a file after the extraction (chmod()).
|
105 |
|
|
This is available for extract() and extractByIndex() functionS by using
|
106 |
|
|
the new variable options parameters.
|
107 |
|
|
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
|
108 |
|
|
- Ability to definition call-back options. These call-back will be called during the adding,
|
109 |
|
|
or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
|
110 |
|
|
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
|
111 |
|
|
can trigerred the change the filename of the extracted file. The user can triggered the
|
112 |
|
|
skip of the extraction. This is adding a 'skipped' status in the file list result value.
|
113 |
|
|
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
|
114 |
|
|
Nothing can be triggered from that point.
|
115 |
|
|
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
|
116 |
|
|
can trigerred the change the stored filename of the added file. The user can triggered the
|
117 |
|
|
skip of the add. This is adding a 'skipped' status in the file list result value.
|
118 |
|
|
- PCLZIP_CB_POST_ADD : will be called after each add of a file.
|
119 |
|
|
Nothing can be triggered from that point.
|
120 |
|
|
- Two status are added in the file list returned as function result : skipped & filename_too_long
|
121 |
|
|
'skipped' is used when a call-back function ask for skipping the file.
|
122 |
|
|
'filename_too_long' is used while adding a file with a too long filename to archive (the file is
|
123 |
|
|
not added)
|
124 |
|
|
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
|
125 |
|
|
a directory.
|
126 |
|
|
- Add a check of the presence of the archive file before some actions (like list, ...)
|
127 |
|
|
- Add the initialisation of field "index" in header array. This means that by
|
128 |
|
|
default index will be -1 when not explicitly set by the methods.
|
129 |
|
|
|
130 |
|
|
Version 1.2 :
|
131 |
|
|
- Adding a duplicate function.
|
132 |
|
|
- Adding a merge function. The merge function is a "quick merge" function,
|
133 |
|
|
it just append the content of an archive at the end of the first one. There
|
134 |
|
|
is no check for duplicate files or more recent files.
|
135 |
|
|
- Improve the search of the central directory end.
|
136 |
|
|
|
137 |
|
|
Version 1.1.2 :
|
138 |
|
|
|
139 |
|
|
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
|
140 |
|
|
(see License section).
|
141 |
|
|
- Adding the optional support of a static temporary directory. You will need to configure
|
142 |
|
|
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
|
143 |
|
|
- Improving the rename() function. In some cases rename() does not work (different
|
144 |
|
|
Filesystems), so it will be replaced by a copy() + unlink() functions.
|
145 |
|
|
|
146 |
|
|
Version 1.1.1 :
|
147 |
|
|
|
148 |
|
|
- Maintenance release, no new feature.
|
149 |
|
|
|
150 |
|
|
Version 1.1 :
|
151 |
|
|
|
152 |
|
|
- New method Add() : adding files in the archive
|
153 |
|
|
- New method ExtractByIndex() : partial extract of the archive, files are identified by
|
154 |
|
|
their index in the archive
|
155 |
|
|
- New method DeleteByIndex() : delete some files/folder entries from the archive,
|
156 |
|
|
files are identified by their index in the archive.
|
157 |
|
|
- Adding a test of the zlib extension presence. If not present abort the script.
|
158 |
|
|
|
159 |
|
|
Version 1.0.1 :
|
160 |
|
|
|
161 |
|
|
- No new feature
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
3 - Corrected bugs
|
165 |
|
|
==================
|
166 |
|
|
|
167 |
|
|
Corrected in Version 2.0 :
|
168 |
|
|
- Corrected : During an extraction, if a call-back fucntion is used and try to skip
|
169 |
|
|
a file, all the extraction process is stopped.
|
170 |
|
|
|
171 |
|
|
Corrected in Version 1.3 :
|
172 |
|
|
- Corrected : Support of static synopsis for method extract() is broken.
|
173 |
|
|
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
|
174 |
|
|
- Corrected : When an extract is done with a remove_path parameter, the entry for
|
175 |
|
|
the directory with exactly the same path is not skipped/filtered.
|
176 |
|
|
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the
|
177 |
|
|
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
|
178 |
|
|
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
|
179 |
|
|
string and not interger). The sort is temporarilly removed, this means that
|
180 |
|
|
you must provide a sorted list of index ranges.
|
181 |
|
|
|
182 |
|
|
Corrected in Version 1.2 :
|
183 |
|
|
|
184 |
|
|
- Nothing.
|
185 |
|
|
|
186 |
|
|
Corrected in Version 1.1.2 :
|
187 |
|
|
|
188 |
|
|
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
|
189 |
|
|
|
190 |
|
|
Corrected in Version 1.1.1 :
|
191 |
|
|
|
192 |
|
|
- Corrected : When archived file is not compressed (0% compression), the
|
193 |
|
|
extract method fails.
|
194 |
|
|
|
195 |
|
|
Corrected in Version 1.1 :
|
196 |
|
|
|
197 |
|
|
- Corrected : Adding a complete tree of folder may result in a bad archive
|
198 |
|
|
creation.
|
199 |
|
|
|
200 |
|
|
Corrected in Version 1.0.1 :
|
201 |
|
|
|
202 |
|
|
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
4 - Known bugs or limitations
|
206 |
|
|
=============================
|
207 |
|
|
|
208 |
|
|
Please publish bugs reports in SourceForge :
|
209 |
|
|
http://sourceforge.net/tracker/?group_id=40254&atid=427564
|
210 |
|
|
|
211 |
|
|
In Version 1.2 :
|
212 |
|
|
|
213 |
|
|
- merge() methods does not check for duplicate files or last date of modifications.
|
214 |
|
|
|
215 |
|
|
In Version 1.1 :
|
216 |
|
|
|
217 |
|
|
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
|
218 |
|
|
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
|
219 |
|
|
add a file in a PclZip created archive. (Corrected in v.1.2)
|
220 |
|
|
|
221 |
|
|
In Version 1.0.1 :
|
222 |
|
|
|
223 |
|
|
- Adding a complete tree of folder may result in a bad archive
|
224 |
|
|
creation. (Corrected in V.1.1).
|
225 |
|
|
- Path given to methods must be in the unix format (/) and not the Windows format (\).
|
226 |
|
|
Workaround : Use only / directory separators.
|
227 |
|
|
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
|
228 |
|
|
added suffix. Files with these names may already exist and may be overwritten.
|
229 |
|
|
Workaround : none.
|
230 |
|
|
- PclZip does not check if the zlib extension is present. If it is absent, the zip
|
231 |
|
|
file is not created and the lib abort without warning.
|
232 |
|
|
Workaround : enable the zlib extension on the php install
|
233 |
|
|
|
234 |
|
|
In Version 1.0 :
|
235 |
|
|
|
236 |
|
|
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
|
237 |
|
|
(Corrected in v.1.0.1)
|
238 |
|
|
- Limitation : Multi-disk zip archive are not supported.
|
239 |
|
|
|
240 |
|
|
|
241 |
|
|
5 - License
|
242 |
|
|
===========
|
243 |
|
|
|
244 |
|
|
Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
|
245 |
|
|
This library is free, so you can use it at no cost.
|
246 |
|
|
|
247 |
|
|
HOWEVER, if you release a script, an application, a library or any kind of
|
248 |
|
|
code using PclZip library (or a part of it), YOU MUST :
|
249 |
|
|
- Indicate in the documentation (or a readme file), that your work
|
250 |
|
|
uses PclZip Library, and make a reference to the author and the web site
|
251 |
|
|
http://www.phpconcept.net
|
252 |
|
|
- Gives the ability to the final user to update the PclZip libary.
|
253 |
|
|
|
254 |
|
|
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
|
255 |
|
|
be aware that someone is using PclZip.
|
256 |
|
|
|
257 |
|
|
For more information about GNU/LGPL license : http://www.gnu.org
|
258 |
|
|
|
259 |
|
|
6 - Warning
|
260 |
|
|
=================
|
261 |
|
|
|
262 |
|
|
This library and the associated files are non commercial, non professional work.
|
263 |
|
|
It should not have unexpected results. However if any damage is caused by this software
|
264 |
|
|
the author can not be responsible.
|
265 |
|
|
The use of this software is at the risk of the user.
|
266 |
|
|
|
267 |
|
|
7 - Author
|
268 |
|
|
==========
|
269 |
|
|
|
270 |
|
|
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
|
271 |
|
|
|
272 |
|
|
8 - Contribute
|
273 |
|
|
==============
|
274 |
|
|
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
|
275 |
|
|
If you can help in financing PhpConcept hosting service, please go to
|
276 |
4
|
ryan
|
http://www.phpconcept.net/soutien.php
|