From: Stig Bakken Date: Mon, 8 Jan 2001 02:54:35 +0000 (+0000) Subject: * display a notice when downloading X-Git-Tag: php-4.0.5RC1~673 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d158a845cf94f5c0cf4478543ef6a34748458d0;p=php * display a notice when downloading --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 27c05c7e04..4d1f724ec6 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -243,6 +243,7 @@ class PEAR_Installer extends PEAR $downloaddir = "/tmp/pearinstall"; $this->mkDirHier($downloaddir); $downloadfile = "$downloaddir/$file"; + $this->log(1, "downloading $pkgfile..."); $fp = @fopen($pkgfile, "r"); if (!$fp) { return $this->raiseError("$pkgfile: failed to download ($php_errormsg)"); @@ -251,7 +252,9 @@ class PEAR_Installer extends PEAR if (!$wp) { return $this->raiseError("$downloadfile: write failed ($php_errormsg)"); } + $bytes = 0; while ($data = @fread($fp, 16384)) { + $bytes += strlen($data); if (!@fwrite($wp, $data)) { return $this->raiseError("$downloadfile: write failed ($php_errormsg)"); } @@ -259,6 +262,7 @@ class PEAR_Installer extends PEAR $pkgfile = $downloadfile; fclose($fp); fclose($wp); + $this->log(1, "...done, $bytes bytes"); $_PEAR_Installer_tempfiles[] = $downloadfile; } $fp = popen("gzip -dc $pkgfile | tar -tf -", "r");