Project

General

Profile

1
// --------------------------------------------------------------------------------
2
// PclZip 2.6 - readme.txt
3
// --------------------------------------------------------------------------------
4
// License GNU/LGPL - March 2006
5
// Vincent Blavet - vincent@phpconcept.net
6
// http://www.phpconcept.net
7
// --------------------------------------------------------------------------------
8
// $Id: readme.txt,v 1.49 2007/07/20 13:56:07 vblavet 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 - Documentation
22
    8 - Author
23
    9 - Contribute
24

    
25
1 - Introduction
26
================
27

    
28
  PclZip is a library that allow you to manage a Zip archive.
29

    
30
  Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
31

    
32
2 - What's new
33
==============
34

    
35
  Version 2.6 :
36
    - Code optimisation
37
    - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
38
      add a comment for a specific file. (Don't really know if this is usefull)
39
    - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string 
40
      as a file.
41
    - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
42
      a file.
43
    - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
44
      with current time
45
    - Add CRC value in the informations returned back for each file after an
46
      action.
47
    - Add missing closedir() statement.
48
    - When adding a folder, and removing the path of this folder, files were
49
      incorrectly added with a '/' at the beginning. Which means files are 
50
      related to root in unix systems. Corrected.
51
    - Add conditional if before constant definition. This will allow users
52
      to redefine constants without changing the file, and then improve
53
      upgrade of pclzip code for new versions.
54
  
55
  Version 2.5 :
56
    - Introduce the ability to add file/folder with individual properties (file descriptor).
57
      This gives for example the ability to change the filename of a zipped file.
58
      . Able to add files individually
59
      . Able to change full name
60
      . Able to change short name
61
      . Compatible with global options
62
    - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
63
    - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
64
    - Add a security control feature. PclZip can extract any file in any folder
65
      of a system. People may use this to upload a zip file and try to override
66
      a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
67
      ability to forgive any directory transversal behavior.
68
    - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
69
    - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
70
    - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
71
      by current path (getcwd())
72
  
73
  Version 2.4 :
74
    - Code improvment : try to speed up the code by removing unusefull call to pack()
75
    - Correct bug in delete() : delete() should be called with no argument. This was not
76
      the case in 2.3. This is corrected in 2.4.
77
    - Correct a bug in path_inclusion function. When the path has several '../../', the
78
      result was bad.
79
    - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will 
80
      disable it while working and det it back to its original value.
81
      This resolve a lots of bad formated archive errors.
82
    - Bug correction : PclZip now correctly unzip file in some specific situation,
83
      when compressed content has same size as uncompressed content.
84
    - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', 
85
      directories are not any more created.
86
    - Code improvment : correct unclosed opendir(), better handling of . and .. in
87
      loops.
88

    
89

    
90
  Version 2.3 :
91
    - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
92
      give the same result in PHP4 and PHP5 ....
93

    
94
  Version 2.2 :
95
    - Try development of PCLZIP_OPT_CRYPT .....
96
      However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
97
      the result (greater than a long) is not supported by PHP. Even the use of bcmath
98
      functions does not help. I did not find yet a solution ...;
99
    - Add missing '/' at end of directory entries
100
    - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
101
      error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
102
    - Corrected : Bad "version need to extract" field in local file header
103
    - Add private method privCheckFileHeaders() in order to check local and central
104
      file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
105
      the ability to have a local file header without size, compressed size and crc filled.
106
    - Add a generic status 'error' for file status
107
    - Add control of compression type. PclZip only support deflate compression method.
108
      Before v2.2, PclZip does not check the compression method used in an archive while
109
      extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
110
      compression method. New status is "unsupported_compression". New error code is
111
      PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
112
    - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
113
      when errors like 'a folder with same name exists' or 'a newer file exists' or
114
      'a write protected file' exists, rather than set a status for the concerning file
115
      and resume the extract of the zip.
116
    - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
117
      replacement of the file, even if a  newer version of the file exists.
118
      Note that today if a file with the same name already exists but is older it will be
119
      replaced by the extracted one.
120
    - Improve PclZipUtilOption()
121
    - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
122
      directory structure is the last data in the archive. Crypt encryption/decryption of
123
      zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
124

    
125
  Version 2.1 :
126
    - Add the ability to abort the extraction by using a user callback function.
127
      The user can now return the value '2' in its callback which indicates to stop the
128
      extraction. For a pre call-back extract is stopped before the extration of the current
129
      file. For a post call back, the extraction is stopped after.
130
    - Add the ability to extract a file (or several files) directly in the standard output.
131
      This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
132
    - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
133
      PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
134
      in the zip archive.
135
    - When merging two archives, the comments are not any more lost, but merged, with a 
136
      blank space separator.
137
    - Corrected bug : Files are not deleted when all files are asked to be deleted.
138
    - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
139

    
140

    
141
  Version 2.0 :
142
    ***** Warning : Some new features may break the backward compatibility for your scripts.
143
                    Please carefully read the readme file.
144
    - Add the ability to delete by Index, name and regular expression. This feature is 
145
      performed by the method delete(), which uses the optional parameters
146
      PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
147
    - Add the ability to extract by regular expression. To extract by regexp you must use the method
148
      extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG 
149
      (depending if you want to use ereg() or preg_match() syntax) followed by the 
150
      regular expression pattern.
151
    - Add the ability to extract by index, directly with the extract() method. This is a
152
      code improvment of the extractByIndex() method.
153
    - Add the ability to extract by name. To extract by name you must use the method
154
      extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
155
      extract or an array of filenames to extract. To extract all a folder, use the folder
156
      name rather than the filename with a '/' at the end.
157
    - Add the ability to add files without compression. This is done with a new attribute
158
      which is PCLZIP_OPT_NO_COMPRESSION.
159
    - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
160
      in a string without using any file (or temporary file).
161
    - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
162
      The default separator is now a comma (,) and not any more a blank space.
163
      THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
164
      your script.
165
    - Improve algorythm performance by removing the use of temporary files when adding or 
166
      extracting files in an archive.
167
    - Add (correct) detection of empty filename zipping. This can occurs when the removed
168
      path is the same
169
      as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
170
    - Add better support for windows paths (thanks for help from manus@manusfreedom.com).
171
    - Corrected bug : When the archive file already exists with size=0, the add() method
172
      fails. Corrected in 2.0.
173
    - Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
174
    - Control the order of index ranges in extract by index feature.
175
    - Change the internal management of folders (better handling of internal flag).
176

    
177

    
178
  Version 1.3 :
179
    - Removing the double include check. This is now done by include_once() and require_once()
180
      PHP directives.
181
    - Changing the error handling mecanism : Remove the use of an external error library.
182
      The former PclError...() functions are replaced by internal equivalent methods.
183
      By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
184
      Introducing the use of constants for error codes rather than integer values. This will help
185
      in futur improvment.
186
      Introduction of error handling functions like errorCode(), errorName() and errorInfo().
187
    - Remove the deprecated use of calling function with arguments passed by reference.
188
    - Add the calling of extract(), extractByIndex(), create() and add() functions
189
      with variable options rather than fixed arguments.
190
    - Add the ability to remove all the file path while extracting or adding,
191
      without any need to specify the path to remove.
192
      This is available for extract(), extractByIndex(), create() and add() functionS by using
193
      the new variable options parameters :
194
      - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
195
    - Ability to change the mode of a file after the extraction (chmod()).
196
      This is available for extract() and extractByIndex() functionS by using
197
      the new variable options parameters.
198
      - PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
199
    - Ability to definition call-back options. These call-back will be called during the adding,
200
      or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
201
      - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
202
        can trigerred the change the filename of the extracted file. The user can triggered the
203
        skip of the extraction. This is adding a 'skipped' status in the file list result value.
204
      - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
205
        Nothing can be triggered from that point.
206
      - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
207
        can trigerred the change the stored filename of the added file. The user can triggered the
208
        skip of the add. This is adding a 'skipped' status in the file list result value.
209
      - PCLZIP_CB_POST_ADD : will be called after each add of a file.
210
        Nothing can be triggered from that point.
211
    - Two status are added in the file list returned as function result : skipped & filename_too_long
212
      'skipped' is used when a call-back function ask for skipping the file.
213
      'filename_too_long' is used while adding a file with a too long filename to archive (the file is
214
      not added)
215
    - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
216
      a directory.
217
    - Add a check of the presence of the archive file before some actions (like list, ...)
218
    - Add the initialisation of field "index" in header array. This means that by
219
      default index will be -1 when not explicitly set by the methods.
220

    
221
  Version 1.2 :
222
    - Adding a duplicate function.
223
    - Adding a merge function. The merge function is a "quick merge" function,
224
      it just append the content of an archive at the end of the first one. There
225
      is no check for duplicate files or more recent files.
226
    - Improve the search of the central directory end.
227

    
228
  Version 1.1.2 :
229

    
230
    - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
231
      (see License section).
232
    - Adding the optional support of a static temporary directory. You will need to configure
233
      the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
234
    - Improving the rename() function. In some cases rename() does not work (different
235
      Filesystems), so it will be replaced by a copy() + unlink() functions.
236

    
237
  Version 1.1.1 :
238

    
239
    - Maintenance release, no new feature.
240

    
241
  Version 1.1 :
242

    
243
    - New method Add() : adding files in the archive
244
    - New method ExtractByIndex() : partial extract of the archive, files are identified by
245
      their index in the archive
246
    - New method DeleteByIndex() : delete some files/folder entries from the archive,
247
      files are identified by their index in the archive.
248
    - Adding a test of the zlib extension presence. If not present abort the script.
249

    
250
  Version 1.0.1 :
251

    
252
    - No new feature
253

    
254

    
255
3 - Corrected bugs
256
==================
257

    
258
  Corrected in Version 2.0 :
259
    - Corrected : During an extraction, if a call-back fucntion is used and try to skip
260
                  a file, all the extraction process is stopped. 
261

    
262
  Corrected in Version 1.3 :
263
    - Corrected : Support of static synopsis for method extract() is broken.
264
    - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
265
    - Corrected : When an extract is done with a remove_path parameter, the entry for
266
      the directory with exactly the same path is not skipped/filtered.
267
    - Corrected : extractByIndex() and deleteByIndex() were not managing index in the
268
      right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
269
      is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
270
      string and not interger). The sort is temporarilly removed, this means that
271
      you must provide a sorted list of index ranges.
272

    
273
  Corrected in Version 1.2 :
274

    
275
    - Nothing.
276

    
277
  Corrected in Version 1.1.2 :
278

    
279
    - Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
280

    
281
  Corrected in Version 1.1.1 :
282

    
283
    - Corrected : When archived file is not compressed (0% compression), the
284
      extract method fails.
285

    
286
  Corrected in Version 1.1 :
287

    
288
    - Corrected : Adding a complete tree of folder may result in a bad archive
289
      creation.
290

    
291
  Corrected in Version 1.0.1 :
292

    
293
    - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
294

    
295

    
296
4 - Known bugs or limitations
297
=============================
298

    
299
  Please publish bugs reports in SourceForge :
300
    http://sourceforge.net/tracker/?group_id=40254&atid=427564
301

    
302
  In Version 2.x :
303
    - PclZip does only support file uncompressed or compressed with deflate (compression method 8)
304
    - PclZip does not support password protected zip archive
305

    
306
  In Version 1.2 :
307

    
308
    - merge() methods does not check for duplicate files or last date of modifications.
309

    
310
  In Version 1.1 :
311

    
312
    - Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
313
    - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
314
      add a file in a PclZip created archive. (Corrected in v.1.2)
315

    
316
  In Version 1.0.1 :
317

    
318
    - Adding a complete tree of folder may result in a bad archive
319
      creation. (Corrected in V.1.1).
320
    - Path given to methods must be in the unix format (/) and not the Windows format (\).
321
      Workaround : Use only / directory separators.
322
    - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
323
      added suffix. Files with these names may already exist and may be overwritten.
324
      Workaround : none.
325
    - PclZip does not check if the zlib extension is present. If it is absent, the zip
326
      file is not created and the lib abort without warning.
327
      Workaround : enable the zlib extension on the php install
328

    
329
  In Version 1.0 :
330

    
331
    - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
332
      (Corrected in v.1.0.1)
333
    - Limitation : Multi-disk zip archive are not supported.
334

    
335

    
336
5 - License
337
===========
338

    
339
  Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
340
  This library is free, so you can use it at no cost.
341

    
342
  HOWEVER, if you release a script, an application, a library or any kind of
343
  code using PclZip library (or a part of it), YOU MUST :
344
  - Indicate in the documentation (or a readme file), that your work
345
    uses PclZip Library, and make a reference to the author and the web site
346
    http://www.phpconcept.net
347
  - Gives the ability to the final user to update the PclZip libary.
348

    
349
  I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
350
  be aware that someone is using PclZip.
351

    
352
  For more information about GNU/LGPL license : http://www.gnu.org
353

    
354
6 - Warning
355
=================
356

    
357
  This library and the associated files are non commercial, non professional work.
358
  It should not have unexpected results. However if any damage is caused by this software
359
  the author can not be responsible.
360
  The use of this software is at the risk of the user.
361

    
362
7 - Documentation
363
=================
364
  PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
365
  A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
366

    
367
8 - Author
368
==========
369

    
370
  This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
371

    
372
9 - Contribute
373
==============
374
  If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
375
  If you can help in financing PhpConcept hosting service, please go to
376
  http://www.phpconcept.net/soutien.php
(4-4/4)