Home » File Formats » File_Archive
File_Archive will let you manipulate easily the tar, gz, tgz, bz2, tbz, zip, ar (or deb) files
This package is unmaintained.
Download latest release 1.5.5 (archived versions might be outdated)
License: LGPL
Description
This library is strongly object oriented. It makes it very easy to use, writing simple code, yet the library is very powerfull.
It lets you easily read or generate tar, gz, tgz, bz2, tbz, zip, ar (or deb) archives to files, memory, mail or standard output.
See http://poocl.la-grotte.org for a tutorial
Documentation
Maintainers
- Vincent Lascaux (vincentlascaux) — lead, inactive
- Charles Brunet (cbrunet) — lead, active
- Pablo Fischer (pfischer) — developer, active
Dependencies
Required
- PHP (>= 4.3.3)
- PEAR Installer (>= 1.4.0b1)
- MIME_Type
- pcre (extension)
- zlib (extension)
Optional
- Mail_Mime
- Cache_Lite (>= 1.5.0)
- bz2 (extension)
Releases
- 1.5.5 (stable, 2012-04-13)
Release notes
License: LGPL
QA release
Made bzip2 extension optional
Bug #19108 upgrade PHPUnit require statements (for PEAR QA Team)
Bug #17257 Corruupted zip file
Bug #17046 AddDirectory.php calls parent constructor incorrectly
Bug #14596 data read during tar import includes slashesBug #14557 bz2 is optional, not required
Request #6631 Host some tutorials on pearweb
- 1.5.4 (stable, 2008-06-05)
- 1.5.3 (stable, 2005-08-16)
Release notes
License: LGPL
Bug #4953 (absolute windows path)
Bug #5095 (date of files when creating a zip archive)
Fix a bug when using File_Archive::appender on non existing archives - 1.5.2 (stable, 2005-07-26)
- 1.5.1 (stable, 2005-07-26)
- 1.5.0 (stable, 2005-07-15)
Release notes
License: LGPL
+ Improved zip reader (File_Archive_Zip_Reader implements more options of the PKZip standard)
+ Some change in the Cache_File use:
- The fileNameProtection is forced to false when setting the cache option
- Add a File_Archive_cleanCache function
To remove the cached compressed version of the files that are no longer present on the system, call
$cache->clean(false, 'callback_File_Archive_cleanCache');
where $cache is the Cache_Lite object passed to File_Archive.
+ Introduce 'blockSize' option that indicates the size of the blocs copied from a reader to a writer when
extracting a file. The default has been set to 64kB but is subject to change in future releases
+ File_Archive::cache to cache a reader if you read it several times in the same script+ 'cacheCondition' option. With this option, you can specify you want to cache all the http
transfer for example. Caching an http transfer ensure that the file won't be downloaded several times
+ File_Archive::readUploadedFile creates a reader on an uploaded file - 1.4.1 (stable, 2005-06-08)
- 1.4.0 (stable, 2005-06-06)
Release notes
License: LGPL
+ Add the possibility to use Cache_Lite to cache intermediary output of Zip compression
+ Add get and setOption method to change the default behavior of readers and writers
Available options are
- zipCompressionLevel: default compression level of zip archives (default is 9)
- gzCompressionLevel: default compression level of gz archives (default is 9)
- tmpDirectory: directory where temporary files will be stored (default is '.')
- cache: instance of Cache_Lite that may be used by any writer to cache data
for future use. Currently used by Zip writer (default is null: no cache)
- appendRemoveDuplicates: specify if the appenders should remove the old files
from an archive to avoid creating duplicates (default is false, which is faster)
+ Add the possibility to use wildcards in read function
File_Archive::read('dir/*.txt') will read all txt files from directory dir
File_Archive::read('archive.zip/*.txt') will read all txt files from the zip archive
Note: The wildcards can only be used after the last '/'
+ All the File_Archive functions that take a reader or a writer as an argument can now take
a string or an array. For readers, strings are interpreted using File_Archive::read function
and array using File_Archive::readMulti. For writers, strings are interpreted using File_Archive::appender
function and array by creating a multi writer. - 1.3.0 (stable, 2005-05-30)
Release notes
License: LGPL
+ Add some functions to allow archive modification
- File_Archive::appender creates a writer to append files to an existing archive
- File_Archive::remove and File_Archive::removeDuplicates removes some files from
an existing archive
These functions allow to modify archives or even nested archives
See http://poocl.la-grotte.org for more detailed examples - 1.2.0 (stable, 2005-05-26)
Release notes
License: LGPL
+ Add an ar (or deb) reader / writer
+ Add a getFileList() on any reader to quickly retrieve file list
+ File_Archive::readArchive properly handles tgz and tbz extensions
+ Better error handling
+ Various bug fixes - 1.1.0 (stable, 2005-05-08)
- 1.0.1 (stable, 2005-04-21)
Release notes
License: LGPL
+ Bug 4192 (<? instead of <?php in some source files)
+ Functions File_Archive::isKnownExtension and File_Archive:;readArchive
added. They allow to specify the type of an archive. This is usefull is the extension
of the file doesn't reflect its real type. - 1.0.0 (stable, 2005-04-16)
Release notes
License: LGPL
+ Bug 4159 (PHP4 compatibility)
+ Bug 4165 (Better USTAR handling in tar files)
+ The package now use temporary files to reduce the amount of memory used
when reading or writing large archives. The following indicates the current
memory usage of the different reader / writers
- Tar writer: constant memory usage
- GZip writer: constant memory usage, temporary file
- BZ2 writer: constant memory usage, temporary file
- ZIP writer: size of the largest file written to the archive
- Tar reader: constant memory usage
- GZip reader: constant memory usage, temporary file
- BZ2 reader: constant memory usage, temporary file
- ZIP reader: size of the largest file read from the archive
The temporary files are created in the current directory. Their name start with
far, their extension is tmp. They are automatically deleted when the reader / writer
is closed. - 0.3.0 (beta, 2005-04-08)
Release notes
License: LGPL
+ Bug 3894
+ The File_Archive::read function does no longer take the optional source parameter
A File_Archive::readSource function has been created that takes the source parameter
+ The mail parameter in File_Archive::toMail is now mandatory, but giving a null variable will
result in using Mail::factory("mail")
+ The File_Archive::toMemory function does no longer take a variable argument
A File_Archive::toVariable function has been created for that - 0.2.0 (beta, 2005-02-24)
Release notes
License: LGPL
+ Add a MIME predicate
+ Change the toArchive function to detect the compression format using the extension of the file
(Warning: this is not backward compatible since the order of the arguments have changed) - 0.1.0 (alpha, 2005-02-20)
Release notes
License: LGPL
First release
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #1899 | Bogus | Bug | 2004-07-16 | Adding an existing file to an archive duplicates the file instead of updating i | |
| #3894 | Closed | Bug | 2005-03-20 | pb with PHP 4.x | |
| #4157 | Closed | Bug | 2005-04-15 | File_Archive::toArchive Pass by reference error | |
| #4159 | Closed | Bug | 2005-04-15 | Archive.php Parse Error in PHP4 | |
| #4165 | Closed | Bug | 2005-04-16 | tar and tar.gz directory structure not maintained | |
| #4192 | Closed | Bug | 2005-04-20 | Strange error with > closing php code | |
| #4204 | Closed | Bug | 2005-04-22 | Parse error Concat.php under PHP4 | |
| #4213 | Bogus | Bug | 2005-04-23 | Call to undefined function extract() | |
| #4233 | Closed | Bug | 2005-04-27 | Wrong Trackback-Link? | |
| #4234 | Closed | Req | 2005-04-27 | No end-user documentation is available | |
| #4327 | No Feedback | Bug | 2005-05-11 | PHP Hang on Permissions | |
| #4376 | No Feedback | Bug | 2005-05-18 | Zip archive wont add files or even download, zero bytes | |
| #4548 | Closed | Bug | 2005-06-07 | $_File_Archive_Options not global | |
| #4916 | Closed | Bug | 2005-07-26 | Fatal error when using extract() | |
| #4921 | Closed | Bug | 2005-07-26 | Inclusion of unexisting files in File/Archive.php | |
| #4925 | Closed | Bug | 2005-07-26 | Archive.php Whitespace | |
| #4953 | Closed | Bug | 2005-07-31 | Extracting does not work with absolute paths | |
| #5024 | Bogus | Bug | 2005-08-08 | Weird behavior with dynamic zip file containing multiple files. | |
| #5095 | Closed | Bug | 2005-08-15 | Code makes no sense | |
| #5145 | Closed | Bug | 2005-08-18 | type on Write/Files.php on line 201 | |
| #5566 | Closed | Req | 2005-09-29 | Patch to support reading JAR archives | |
| #5590 | Duplicate | Req | 2005-10-03 | dead link | |
| #5678 | Duplicate | Bug | 2005-10-12 | File_Archive is broken in php 5.1rc1 | |
| #5792 | Closed | Req | 2005-10-27 | Package needs to provide more meaningful errors | |
| #5903 | Closed | Req | 2005-11-09 | tutotial site for File_Archive is unreachable | |
| #5991 | Closed | Bug | 2005-11-17 | Doesn't read deeply nested Tar files with @LongLink | |
| #6387 | Closed | Bug | 2006-01-01 | Unable to open zip files created on a PC | |
| #6496 | Closed | Req | 2006-01-15 | Examples needed and external documentation page not reachable | |
| #6546 | Assigned | Bug | 2006-01-21 | File added twice | |
| #6570 | Closed | Bug | 2006-01-24 | Archive names with spaces not handled in Firefox | |
| #6631 | Closed | Req | 2006-01-30 | Host some tutorials on pearweb | |
| #6646 | Closed | Bug | 1.5.3 | 2006-01-31 | var filename missing $ |
| #6743 | Closed | Bug | 1.5.3 | 2006-02-10 | uppercase problem |
| #7650 | Closed | Bug | 1.5.3 | 2006-05-17 | "Only variables should be assigned by reference" notice |
| #8187 | Closed | Bug | 1.5.3 | 2006-07-11 | paths get too much mangled |
| #8647 | Closed | Bug | CVS | 2006-09-07 | confusion between 'n' and ',' |
| #9676 | Closed | Bug | 1.5.3 | 2006-12-21 | Problem ready Mac Archive Files |
| #10144 | Verified | Bug | 1.5.3 | 2007-02-21 | long filenames are not stored correctly |
| #10219 | Verified | Bug | 1.5.3 | 2007-02-28 | Not any Archive inside an archive wont be recognises while extracting |
| #10247 | Closed | Bug | 1.5.3 | 2007-03-02 | unnecessary calls to die() |
| #11084 | Closed | Req | CVS | 2007-05-20 | Needs a package 2.0 file |
| #12175 | Closed | Bug | 1.5.3 | 2007-10-02 | Missing include to File_Archive_Reader_Filter |
| #12180 | No Feedback | Bug | 1.5.3 | 2007-10-03 | unable to extract zip archives from eclipse |
| #12294 | Wont fix | Bug | 1.5.3 | 2007-10-22 | No error if MIME_Type package not installed |
| #12448 | Closed | Bug | 1.5.3 | 2007-11-14 | Empty directories removed when extracting .tar.gz |
| #12450 | Closed | Bug | 1.5.3 | 2007-11-15 | mail() function fails and extract() returns null |
| #12601 | Bogus | Bug | 1.5.3 | 2007-12-03 | toMail() produces ugly e-mails |
| #12617 | Analyzed | Req | 1.5.3 | 2007-12-05 | Incorrectly marks an archive/file as compressed when it's not |
| #13204 | Duplicate | Bug | 1.5.3 | 2008-02-25 | incorrectly extracts zip archives made with OS X |
| #13251 | Duplicate | Bug | 1.5.3 | 2008-02-28 | Adding a folder with subfolders results in multiple occurrence of single files |
| #13311 | Closed | Bug | 1.5.3 | 2008-03-05 | 64bit systems can't extract zip files |
| #13390 | No Feedback | Bug | 1.5.3 | 2008-03-13 | .tar.bz2 files not extracting |
| #13498 | Duplicate | Bug | 1.5.3 | 2008-03-25 | extract function bug, multiple files included. |
| #13499 | Duplicate | Bug | 1.5.3 | 2008-03-25 | extract function bug, multiple files included. |
| #13516 | Closed | Bug | 1.5.3 | 2008-03-27 | Warnings in File/Archive/Writer/Files.php |
| #13723 | Bogus | Bug | CVS | 2008-04-19 | Only variables should be assigned by reference (E_STRICT) |
| #13904 | Closed | Bug | CVS | 2008-05-14 | bzopen doesn't support compression level |
| #14547 | Open | Req | 1.5.4 | 2008-08-22 | Unable to create archive with an empty directory |
| #14557 | Closed | Bug | 1.5.4 | 2008-08-25 | bz2 is optional, not required |
| #14559 | Open | Req | 1.5.4 | 2008-08-25 | Use PHP ZIP extension |
| #14578 | No Feedback | Bug | 1.5.4 | 2008-08-28 | .zip file results are corrupt |
| #14596 | Closed | Bug | 1.5.4 | 2008-09-04 | data read during tar import includes slashes |
| #14621 | Open | Bug | 1.5.4 | 2008-09-08 | unmodifyName mangles filename |
| #14622 | Assigned | Bug | 1.5.4 | 2008-09-08 | reading tar files with split filenames needs slash inserted |
| #15673 | Feedback | Bug | 1.5.4 | 2009-01-18 | Directories in root of zip file are ignored. |
| #16461 | Bogus | Bug | 1.5.4 | 2009-07-22 | Error for large file sizes (over 3.5Mb) |
| #17046 | Closed | Bug | 1.5.4 | 2010-01-30 | AddDirectory.php calls parent constructor incorrectly |
| #17257 | Closed | Bug | 1.5.4 | 2010-03-24 | Corruupted zip file |
| #17330 | Open | Bug | 1.5.4 | 2010-04-21 | File_Archive create invalid zip file |
| #17435 | Feedback | Req | Unknown | 2010-05-25 | Handling xz and lzma archive |
| #17836 | Open | Bug | SVN | 2010-08-31 | Deprecated functionality (as of PHP 5.3) |
| #18076 | Open | Bug | 1.5.4 | 2010-11-19 | Reader select error |
| #18077 | Duplicate | Bug | 1.5.4 | 2010-11-19 | Reader select error |
| #18337 | Open | Bug | 1.5.4 | 2011-03-04 | Call to undefined method File_Archive_Reader_ChangeName |
| #18338 | Duplicate | Bug | 1.5.4 | 2011-03-04 | Call to undefined method File_Archive_Reader_ChangeName |
| #19105 | Open | Bug | 1.5.4 | 2011-12-07 | Notice error in File_Archive.php |
| #19108 | Closed | Bug | SVN | 2011-12-07 | upgrade PHPUnit require statements (for PEAR QA Team) |
| #20064 | Open | Bug | 1.5.5 | 2013-09-17 | compress directory and generated double,triple file. |
| #20065 | Open | Bug | 1.5.5 | 2013-09-17 | compress directory and generated double,triple file. |