Re: zippidity do duh!
| From: | Nathan Nobbe | Date: | Wed, 09 Jul 2008 22:27:22 +0000 |
| Subject: | Re: zippidity do duh! | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276541@lists.php.net to get a copy of this message | ||
On Wed, Jul 9, 2008 at 3:10 PM, Eric Butera <eric.butera@gmail.com> wrote:
> On Wed, Jul 9, 2008 at 4:00 PM, Nathan Nobbe <quickshiftin@gmail.com>
> wrote:
> > On Wed, Jul 9, 2008 at 1:43 PM, tedd <tedd@sperling.com> wrote:
> >
> >> Hi gang:
> >>
> >> I'm trying to do some zip stuff, but on server [1] my script hangs on:
> >>
> >> $zip = new ZipArchive();
> >>
> >> No errors, no anything, it just hangs -- I assuming that ZipArchive is
> not
> >> available.
> >>
> >> ---
> >>
> >> However, on server [2] (Daniel Brown's most excellent service, btw),
> >> everything works great -- as is usual (every time I say something like
> this
> >> he gives me another month of free service). :-)
> >>
> >> I've done phpinfo's on both servers, but don't see any obvious
> differences.
> >>
> >> Outside of running my script on different servers to see if it works, is
> >> there anyway I can tell beforehand if ZipArchive is available or not?
> >
> >
> > if(class_exists('ZipArchive', false))
> > $zip = new ZipArchive();
> > else
> > trigger_error('class ZipArchive does not exist!', E_USER_NOTICE);
> >
> > -nathan
> >
>
> But it deals with classes therefore it must thrown an exception, right? ;D
only if you want to be able to detect the error from the calling code and do
something as a result. i just put this there, mainly as an example :)