Re: cvs: php4 /pear/PEAR Installer.php
| From: | Tomas V.V.Cox | Date: | Wed, 13 Feb 2002 10:33:17 +0000 |
| Subject: | Re: cvs: php4 /pear/PEAR Installer.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-2418@lists.php.net to get a copy of this message | ||
Hi Stig,
JFYI, I implemented HTTP::head($url) (which maybe should be moved to
HTTP_Client) for that, but finally didn't get the time to add it to
Installer. Perhaps it helps you if you still need to get the
Content-Disposition (this is the filename).
Tomas V.V.Cox
Stig Bakken wrote:
>
> ssb Tue Feb 12 20:40:18 2002 EDT
>
> Modified files:
> /php4/pear/PEAR Installer.php
> Log:
> * "pear-get install Auth" works now
>
>
> Index: php4/pear/PEAR/Installer.php
> diff -u php4/pear/PEAR/Installer.php:1.35 php4/pear/PEAR/Installer.php:1.36
> --- php4/pear/PEAR/Installer.php:1.35 Thu Jan 24 03:23:47 2002
> +++ php4/pear/PEAR/Installer.php Tue Feb 12 20:40:18 2002
> @@ -18,7 +18,7 @@
> // | |
> // +----------------------------------------------------------------------+
> //
> -// $Id: Installer.php,v 1.35 2002/01/24 08:23:47 vblavet Exp $
> +// $Id: Installer.php,v 1.36 2002/02/13 01:40:18 ssb Exp $
>
> require_once 'PEAR/Common.php';
> require_once 'PEAR/Registry.php';
> @@ -190,8 +190,9 @@
> "/get/$pkgfile";
> }
> $need_download = true;
> + } else {
> + return $this->raiseError("could not open the package file:
> $pkgfile");
> }
> - return $this->raiseError("could not open the package file:
> $pkgfile");
> }
>
> // Download package -----------------------------------------------
> @@ -206,6 +207,9 @@
> if (!$fp = @fopen($pkgfile, 'r')) {
> return $this->raiseError("$pkgfile: failed to download
> ($php_errormsg)");
> }
> + // XXX FIXME should check content-disposition header
> + // for now we set the "force" option to avoid an error
> + // because of a temp. package file called "Package"
> if (!$wp = @fopen($downloadfile, 'w')) {
> return $this->raiseError("$downloadfile: write failed
> ($php_errormsg)");
> }
> @@ -241,6 +245,7 @@
> chdir($oldcwd);
> return $this->raiseError("unable to unpack $pkgfile");
> }
> +/*
> $file = basename($pkgfile);
> // Assume the decompressed dir name
> if (($pos = strrpos($file, '.')) === false) {
> @@ -248,6 +253,12 @@
> return $this->raiseError("invalid package name");
> }
> $pkgdir = substr($file, 0, $pos);
> +*/
> + $dp = opendir($tmpdir);
> + do {
> + $pkgdir = readdir($dp);
> + } while ($pkgdir{0} == '.');
> +
> $descfile = $tmpdir . DIRECTORY_SEPARATOR . $pkgdir . DIRECTORY_SEPARATOR .
> 'package.xml';
>
> if (!is_file($descfile)) {
>
> --
> PEAR CVS Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php