Has anybody attemped to replace the unzip tool with a pure PHP implementation? I'm interested in doing this since the hosting service I'm using (godaddy.com) doesn't provide unzip.
I have a general idea where the modification needs to happen, but haven't a clue about implementing it.
In modules/archiveupload/classes/ArchiveExtractToolkit.class there is this line:
list ($success) = $platform->exec(array(array($unzip, $sourceFilename)));
That's where the unzip exec happens, but what's the best way of replacing this with a php unzip function that uses a syntax like unzip($filename,$destpath)?
Jason
Posts: 70
your on the right track.
check out the comments here, it should help you out with what you need
http://us2.php.net/zip
-Draco
|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||
Posts: 32509
implementing in pure php isn't a good idea. it would take much much longer and you'd take a lot of the server cpu resources.
http://www.php.net/zip would be worth a try.
Posts: 70
beat yeah ;) (down to the minute, wheres the second counter on that one )
-edit- I read more into this and valiant is definetly right on the cpu usage. You might want to check into what commands are available and work with those if possible before doing a pure php unzip.
-Draco
|| G1 + G2 Hosting | Custom Theming | Donate to Gallery ||
Posts: 2
Well, the downside to the built-in zip support PHP offers is that it requires support for ZZIPlib to be compiled in. GoDaddy.com doesn't have that support included in their PHP install. So, I'm either left with finding out if they have an unzip executable or using a pure php implementation. I don't think the PHP implementation would be too bad, since we're only talking about <8MB zip files. 8MB is their upload limit anyway.
Thanks for the replies, though...
Posts: 23
I have attached the zip and unzip package I use on godaddy. Just make sure you set the path correctly in gallery.
nef
Posts: 1
I also use GoDaddy for hosting and since I've been interested in opening archives on the site I was looking for some "cheats" where somone else already did the legwork on the PHP. While you are correct that the zziplib is not installed, zlib IS in installed. At least on my Version 2 Linux hosting. If you've not upgraded yet, do so. You get more space, more BW and less $. This includes PHP 5 and the entire GZip lib is installed then. Downside is this works on .gz files so you might have to change things around a bit for your situation to work.
Good luck.
http://us2.php.net/manual/en/ref.zlib.php This ones included.