readme.txt 19 KB

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