From: Stig Bakken Date: Tue, 23 Apr 2002 06:49:10 +0000 (+0000) Subject: * downloadHttp: pass the total number of bytes downloaded as parameter X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e22ee6a085488002ce7671604576cdd0e1dd7638;p=php * downloadHttp: pass the total number of bytes downloaded as parameter to the 'done' callback --- diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 074e2ae29e..e7633242b6 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -1285,7 +1285,8 @@ class PEAR_Common extends PEAR * 'start' download is starting, parameter is number of bytes * that are expected, or -1 if unknown * 'bytesread' parameter is the number of bytes read so far - * 'done' download is complete, no parameter + * 'done' download is complete, parameter is the total number + * of bytes read * * If an HTTP proxy has been configured (http_proxy PEAR_Config * setting), the proxy will be used. @@ -1293,8 +1294,8 @@ class PEAR_Common extends PEAR * @param string $url the URL to download * @param object $ui PEAR_Frontend_* instance * @param object $config PEAR_Config instance - * @param string $save_dir directory to save file in - * @param mixed $callback function/method to call for status + * @param string $save_dir (optional) directory to save file in + * @param mixed $callback (optional) function/method to call for status * updates * * @return string Returns the full path of the downloaded file or a PEAR @@ -1389,7 +1390,7 @@ class PEAR_Common extends PEAR fclose($fp); fclose($wp); if ($callback) { - call_user_func($callback, 'done'); + call_user_func($callback, 'done', $bytes); } // callback: done! return $dest_file;