PHP zip file class

I'm working on a Drupal module (can't say what) that needs to create a archive. I landed on ZIP, because it's the easiest to implement without requiring any external libs.
I searched around and found this, and with a few improvements I ended up with this: http://xqus.com/tools/class.zipfile.phps

The following changes were made:

  • Changed the name of the output method to save
  • Added some error checking in the save method
  • Made the save method return boolean
  • Added a check to see if the $files param to addFiles in an array
  • Changed the way the addFiles method reads file contents
  • Made the addFiles method return boolean
  • Made a output method to output the zipfile directly to the browser
Can you re-submit your code,

Can you re-submit your code, or even better create a project in Drupal?

Submitted by Amitai (not verified) on Mon, 06/02/2008 - 13:21.
http://xqus.com/tools/class.z

http://xqus.com/tools/class.zipfile.phps

Submitted by xqus on Sat, 07/12/2008 - 20:59.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><pre><blockquote>
  • Lines and paragraphs break automatically.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].

More information about formatting options