PHP Classes

PHP Archive: Extract contents of ZIP, TAR, RAR, PHAR archives

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2015-07-20 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 385 All time: 6,206 This week: 1,103Up
Version License PHP version Categories  
php-archive 1.0.3GNU General Publi...5.3PHP 5, Compression
Description Author  

This class can extract contents of ZIP, TAR, RAR, PHAR archives.

It can open compressed archives in the ZIP, TAR, RAR, PHAR formats and list their file contents.

The class can also extract the archive files into a given directory or output the contents of specific files.

Picture of wapmorgan
  Performance   Level  
Name: wapmorgan is available for providing paid consulting. Contact wapmorgan .
Classes: 22 packages by
Country: Russian Federation Russian Federation
Age: ???
All time rank: 112936 in Russian Federation Russian Federation
Week rank: 184 Up9 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 8x

Winner: 1x



Archive - tool for those who work with many popular archive formats (rar, zip and tar) a lot and want to avoid using different tools from command line.



If you want install that program for current directory only: ` wget -O archive && chmod +x archive `

If you want install that program for all system (run as root): ` wget -O archive && chmod +x archive mv archive /usr/local/bin `


  1. Manually download archive.bat and archive.php.
  2. Move to system folder like (C:\Windows).
  3. Run it from any folder like ` archive `


Usage is pretty simple:

archive [archive] {action} FILES... [--listFormat=] [--extractDir=]


  • index You can get the list of files stored in archive. By passing --listFormat option you can specify output format. It has syntax similar to sprintf() format. The main improvement is you can specify placeholders like this: @placeholder%format where placeholder is an identificator of property for array entry. Default listFormat: @name%40s | @size%d | @datetime%s.
  • extract Extract archive files to dir. By passing --extractDir option you can specify output directory.
  • print FILES... Print the files contents to standard output. Useful for on-the-fly searching.

Run archive without arguments to see all manual.

  Files folder image Files  
File Role Description
Accessible without login Plain text file archive.bat Data Auxiliary data
Accessible without login Plain text file archive.php Class Class source
Plain text file composer.json Data Auxiliary data
Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%Total:385All time:6,206
 This week:0This week:1,103Up