Archive_Tar pear.php.net Tar file management class This class provides handling of tar files in PHP. It supports creating, listing, extracting and adding to tar files. Gzip support is available if PHP has the zlib extension built-in or loaded. Bz2 compression is also supported with the bz2 extension loaded. Also Lzma2 compressed archives are supported with xz extension. Vincent Blavet vblavet vincent@phpconcept.net no Greg Beaver cellog greg@chiaraquartet.net no Michiel Rook mrook mrook@php.net no Drew Webber mcdruid drew@mcdruid.co.uk yes Stig Bakken ssb stig@php.net no 2024-03-16 1.5.0 1.5.0 stable stable New BSD License * PR #42: fix @return true... to @return bool true... on some functions * PR #46: use 775 default for mkdirs, to avoid world-write PEAR pear.php.net 1.8.0 1.10.10 5.2.0 1.9.0 1.5.0 1.5.0 stable stable 2024-03-16 New BSD License * PR #42: fix @return true... to @return bool true... on some functions * PR #46: use 775 default for mkdirs, to avoid world-write 1.4.14 1.4.0 stable stable 2021-02-16 New BSD License * Properly fix symbolic link path traversal (CVE-2021-32610) 1.4.13 1.4.0 stable stable 2021-02-16 New BSD License * Fix Bug #27010: Relative symlinks failing (out-of path file extraction) [mrook] 1.4.12 1.4.0 stable stable 2021-01-18 New BSD License * Fix Bug #27008: Symlink out-of-path write vulnerability (CVE-2020-36193) [mrook] 1.4.11 1.4.0 stable stable 2020-11-19 New BSD License * Fix Bug #27002: Filename manipulation vulnerabilities (CVE-2020-28948 / CVE-2020-28949) [mrook] 1.4.10 1.4.0 stable stable 2020-09-15 New BSD License * Fix block padding when the file buffer length is a multiple of 512 and smaller than Archive_Tar buffer length * Don't try to copy username/groupname in chroot jail 1.4.9 1.4.0 stable stable 2019-12-04 New BSD License * Implement Feature #23861: Add option to disallow symlinks [mrook] 1.4.8 1.4.0 stable stable 2019-10-21 New BSD License * Fix Bug #23852: PHP 7.4 - Archive_Tar->_readHeader throws deprecation [mrook] 1.4.7 1.4.0 stable stable 2019-04-08 New BSD License * Improved performance by increasing read buffer size 1.4.6 1.4.0 stable stable 2019-02-01 New BSD License * Improve path traversal detection for forward and backward slashes 1.4.5 1.4.0 stable stable 2019-01-02 New BSD License * Fix Bug #23788: Relative symlinks are broken [mrook] 1.4.4 1.4.0 stable stable 2018-12-20 New BSD License * Fix Bug #21058: Long symlinks are not supported [mrook] * Fix Bug #23782: Prevent phar:// files from being extracted [mrook] 1.4.3 1.4.0 stable stable 2017-06-11 New BSD License * Fix Bug #21218: Cannot use result of built-in function in write context in PHP 7.2.0alpha1 [mrook] 1.4.2 1.4.0 stable stable 2016-02-25 New BSD License * Fix reading of archives with files > 8GB * Performance optimizations * Do not try to call require_once on PEAR.php if it has already been loaded by the autoloader 1.4.1 1.4.0 stable stable 2015-08-05 New BSD License * Update composer.json to use pear-core-minimal 1.10.0alpha2 1.4.0 1.4.0 stable stable 2015-07-20 New BSD License * Add support for PHP 7 * Drop support for PHP 4 * Add visibility declarations to methods and properties 1.3.16 1.3.1 stable stable 2015-04-14 New BSD License * Fix Bug #20514: invalid package.xml; not installable with pyrus [mrook] 1.3.15 1.3.1 stable stable 2015-03-05 New BSD License * Fixes composer.json parse error 1.3.14 1.3.1 stable stable 2015-02-26 New BSD License * Fix Bug #18505: Possible incorrect handling of file names in TAR [mrook] 1.3.13 1.3.1 stable stable 2014-09-02 New BSD License * Fix Bug #20382: gzopen fix [mrook] 1.3.12 1.3.1 stable stable 2014-08-04 New BSD License * Fix Bug #19964: Memory leaking in Archive_Tar [mrook] * Fix Bug #20246: Broken with php 5.5.9 [mrook] * Fix Bug #20275: "pax_global_header" looks like a regular file * [mrook] * Implement Feature #19827: pass filename to _addFile function - downstream * patch [mrook] * Implement Feature #20132: Add custom mode/uid/gid to addString() [mrook] 1.3.11 1.3.1 stable stable 2013-02-09 New BSD License * Fix Bug #19746: Broken with PHP 5.5 [mrook] * Implement Feature #11258: Custom date/time in files added on-the-fly * [mrook] 1.3.10 1.3.1 stable stable 2012-04-10 New BSD License * Fix Bug #13361: Unable to add() some files (ex. mp3) [mrook] * Fix Bug #19330: Class creates incorrect (non-readable) tar.gz file * [mrook] 1.3.9 1.3.1 stable stable 2012-02-27 New BSD License * Fix Bug #16759: No error thrown from missing PHP zlib functions [mrook] * Fix Bug #18877: Incorrect handling of backslashes in filenames on Linux [mrook] * Fix Bug #19085: Error while packaging [mrook] * Fix Bug #19289: Invalid tar file generated [mrook] 1.3.8 1.3.1 stable stable 2011-10-14 New BSD License * Fix Bug #17853: Test failure: dirtraversal.phpt [mrook] * Fix Bug #18512: dead links are not saved in tar file [mrook] * Fix Bug #18702: Unpacks incorrectly on long file names using header prefix [mrook] * Implement Feature #10145: Patch to return a Pear Error Object on failure [mrook] * Implement Feature #17491: Option to preserve permissions [mrook] * Implement Feature #17813: Prevent PHP notice when extracting corrupted archive [mrook] 1.3.7 1.3.1 stable stable 2010-04-26 New BSD License PEAR compatibility update 1.3.6 1.3.1 stable stable 2010-03-09 New BSD License * Fix Bug #16963: extractList can't extract zipped files from big tar [mrook] * Implement Feature #4013: Ignoring files and directories on creating an archive. [mrook] 1.3.5 1.3.1 stable stable 2009-12-31 New BSD License * Fix Bug #16958: Update 'compatible' tag in package.xml [mrook] 1.3.4 1.3.1 stable stable 2009-12-30 New BSD License * Fix Bug #11871: wrong result of ::listContent() if filename begins or ends with space [mrook] * Fix Bug #12462: invalid tar magic [mrook] * Fix Bug #13918: Long filenames may get up to 511 0x00 bytes appended on read [mrook] * Fix Bug #16202: Bogus modification times [mrook] * Implement Feature #16212: Die is not exception [mrook] 1.3.3 1.3.1 stable stable 2009-03-27 New BSD License Change the license to New BSD license minor bugfix release * fix Bug #9921 compression with bzip2 fails [cellog] * fix Bug #11594 _readLongHeader leaves 0 bytes in filename [jamessas] * fix Bug #11769 Incorrect symlink handing [fajar99] 1.3.2 1.3.1 stable stable 2007-01-03 PHP License Correct Bug #4016 Remove duplicate remove error display with '@' Correct Bug #3909 : Check existence of OS_WINDOWS constant Correct Bug #5452 fix for "lone zero block" when untarring packages Change filemode (from pear-core/Archive/Tar.php v.1.21) Correct Bug #6486 Can not extract symlinks Correct Bug #6933 Archive_Tar (Tar file management class) Directory traversal Correct Bug #8114 Files added on-the-fly not storing date Correct Bug #9352 Bug on _dirCheck function over nfs path 1.3.1 1.3.1 stable stable 2005-03-17 PHP License Correct Bug #3855 1.3.0 1.3.0 stable stable 2005-03-06 PHP License Bugs correction (2475, 2488, 2135, 2176) 1.2 1.2 stable stable 2004-05-08 PHP License Add support for other separator than the space char and bug correction 1.1 1.1 stable stable 2003-05-28 PHP License * Add support for BZ2 compression * Add support for add and extract without using temporary files : methods addString() and extractInString() 1.0 1.0 stable stable 2003-01-24 PHP License Change status to stable 0.10-b1 0.10-b1 beta beta 2003-01-08 PHP License Add support for long filenames (greater than 99 characters) 0.9 0.9 stable stable 2002-05-27 PHP License Auto-detect gzip'ed files 0.4 0.4 stable stable 2002-05-20 PHP License Windows bugfix: use forward slashes inside archives 0.2 0.2 stable stable 2002-02-18 PHP License From initial commit to stable 0.3 0.3 stable stable 2002-04-13 PHP License Windows bugfix: used wrong directory separators