Re: Package Proposal: HTTP_Download
| From: | nicos@php.net | Date: | Mon, 05 May 2003 14:57:55 +0000 |
| Subject: | Re: Package Proposal: HTTP_Download | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15896@lists.php.net to get a copy of this message | ||
Looks very nice, same for the code, +1.
--
Regards.
M.CHAILLAN Nicolas
nicos@php.net
www.WorldAKT.com Hébergement de sites internets.
"Stefan Walk" <post@fuer-et.de> a écrit dans le message news:
20030505142131.GA8231@prp0.prp.physik.tu-darmstadt.de...
> On Mon, May 05, 2003 at 08:59:56AM -0500, Paul M Jones wrote:
> > How about some examples or quick text/HTML docs? Looks neat, but I am
> > not sure from the code how one is to use it.
> >
> >
> > _______________________________________________________________________
> >
> > Paul M. Jones
> > pjones@ciaweb.net
> > http://ciaweb.net
>
> Example:
>
> $dl = new
> HTTP_Download('http://sourcehost.com/sourcefile',
> '/path/to/target.file');
>
> <?php
> $status = $dl->init();
>
> if (PEAR::isError($status)) {
> // handle error
> }
>
> // now, we have two ways to continue... either
>
> while($dl->transferChunk($size)) {
> // watcher code
> }
>
> // or:
>
> $dl->transferComplete($chunksize, $callback);
>
> // with the callback beign called for every chunk that gets transferred
>
> ?>
>
> Regards, Stefan Walk