readme.txt 18 KB

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