apsinghbrar / cxc-templates

Automatically exported from code.google.com/p/cxc-templates
0 stars 0 forks source link

error using file upload - ZipArchive class missing #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using Extentions -> Template, choose zipped template file on local computer 
(stuart's one downloaded from this site)

2. Click upload

What is the expected output? 
zipped template file uploaded

What do you see instead?
Fatal error: Class 'ZipArchive' not found in 
/home/faim/FamilyAndIntegrativeMedicine.com/textpattern/lib/txplib_misc.php(653)
 : eval()'d code on line 911

What version of the product are you using? On what operating system?
.0.5 on Mac OS 10.5.8 (uploading from) to Debian Linux (where site is hosted)

Please provide any additional information below.

have not had issues with uploading standard zipped files using 
smd_admin_themes, so not sure why this zipped file is giving me a problem.

Original issue reported on code.google.com by tecumseh...@gmail.com on 19 Jan 2011 at 7:53

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I believe the host does not have PHP’s zlib turned on so the ZipArchive class 
is unavailable.

I'm looking into alternatives for the ZipArchive class and studying 
smd_admin_themes to see how it has circumvented this. 

Can you verify whether or not PHP's zlib is turned on by your host?

smd_admin_themes offers support for additional filetypes also, zip, bzip2, tar 
and gzip and uses completely different methods of extraction. 

I had originally intended make the Upload/Download features only visible if 
zlib was present and turned on but I forgot to add that into the plugin and I 
must admit that the solution used by Stef is way over my head :(

Original comment by chaosXonline@gmail.com on 20 Jan 2011 at 5:52

GoogleCodeExporter commented 8 years ago
Am away from my computer. Will double check when I get back. Am on DreamHost. 
I'm pretty sure they have gzip support if that helps. 

Mike Dennis

Original comment by tecumseh...@gmail.com on 20 Jan 2011 at 6:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
GZip and Zip are unfortunately different, I'm still learning PHP archive 
classes but they use different classes if I understand correctly. I may be hit 
or miss on the details unfortunately but if you go to 
http://www.php.net/manual/en/refs.compression.php it is the zip class right 
above zlib on that page. The zip class does require zlib but there are obvious 
differences.

Some post that might help solve the issue for you ...

http://discussion.dreamhost.com/thread-117307.html
http://discussion.dreamhost.com/thread-112685.html

... I, like you, would have expected zlib to be on by default for DreamHost but 
it appears to be quite confusing. Please keep me informed with how it all works 
out, Stef's plugin creates its own class to handle zipping/unzipping and it is 
that class that makes up around half of the code in smd_admin_themes, I barely 
understand it :( that's why I was only able to offer support for .zip formats.

I do need to fix the plugin to hide the zip options if zlib and ZipArchive are 
not available but I don't think I would be able to code a solution or reuse 
Stef's solution myself, its just way over my head :(

Original comment by chaosXonline@gmail.com on 20 Jan 2011 at 10:51

GoogleCodeExporter commented 8 years ago
Had a few minutes and checked out the links you shared, and did some additional 
digging.

Using the current installed version of php (5.2.x) , as you noted, it appears 
Dreamhost has not offered the ziparchive feature out of the box. It apparently 
requires compiling a custom php install with it enabled.  

The other work around is to ftp an unzipped file or to upload it and unzip it 
using ssh.

However, they have 5.3.x in beta, and zip is enable by default in that install. 
(At least for now).  I switch the site I'm testing cxc_template on to 5.3.x and 
it is uploading zip files as expected.

re: smd_admin_themes --- perhaps it might be worth check w/ Stef to see if he 
could/would break out his upload/compressions into separate plugin that other 
plugins could make use of.'

Thanks for the follow up.

I've got a couple other questions, but will start separate threads according to 
topic. 

Do you prefer the google issue tracker or txp forums for questions/issues?

Thanks again

Mike

Original comment by tecumseh...@gmail.com on 23 Jan 2011 at 1:29

GoogleCodeExporter commented 8 years ago
Its easier for me to follow Google but I'm trying to pay attention to both.

Original comment by chaosXonline@gmail.com on 23 Jan 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Stef explained how to use the classes in smd_admin_themes and I've began 
working on modifying the plugin to use them instead of the ZipArchive 
dependency.

Follow the discussion at http://forum.textpattern.com/viewtopic.php?id=35319&p=1

Original comment by chaosXonline@gmail.com on 27 Jan 2011 at 10:06

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Still requires the ZLib module but ZipArchive class dependency removed by 
implementing Stef's method of compression.

Original comment by chaosXonline@gmail.com on 30 Jan 2011 at 10:41