tags:

views:

16

answers:

2

hey guys , im dealing with a script that it should compress and folder and make it ready in 3 versions :

7z zip tar.gz

surely i did found a way on how to make a zip file out of a folder in php by using a zip compression class

http://www.phpclasses.org/package/2322-PHP-Create-ZIP-file-archives-and-serve-for-download.html

but for 7z and tar.gz format no idea on how to do the compression

is there any way to make an 7z or tar.gz compressed file !?

specially 7z format

+1  A: 

I suggest you install the relevant programs on the server, and call them from php via exec() to compress your files for you. Why bother rewriting the compression code when it's already been written?

Sam Dufel
+1  A: 

Assuming Linux and having these (basic) tools already available:

exec("zip -r archive_name.zip directory_to_compress");
exec("tar -zcvf archive_name.tar.gz directory_to_compress");

For 7zip, you can check out this project on SourceForge.

jnpcl