Re: pecl and the pear installer
| From: | Greg Beaver | Date: | Tue, 26 Jul 2005 18:19:25 +0000 |
| Subject: | Re: pecl and the pear installer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-38900@lists.php.net to get a copy of this message | ||
Michael Wallner wrote:
Hi Greg and folks,
I tried to install the fresh pecl_http-0.10.0 through pear,
which oddly failed at a point of the package.xml which I was
quite used to use.
In this version I introduces PHP dependencies, and I usually
require one version while recommendin another one with the
following dependencies entry in package.xml:
<deps>
<dep type="php" rel="ge" version="4.3.1" optional="no" />
<dep type="php" rel="ge" version="5.0.4" optional="yes" />
</deps>
I wonder because I've many PEAR packages specifying such dependencies
and those worked well with PEAR-1.4 as far as I can tell.
s1-iw:~# pear -V
PEAR Version: 1.4.0a12
PHP Version: 4.3.10-15
s1-iw:~# peardev upgrade HTTP_Download
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Did not download dependencies: pear/HTTP_Header, pear/Archive_Zip, use --alldeps or --onlyreqdeps to download automatically
pear/HTTP_Download can optionally use package "pear/Archive_Zip"
downloading HTTP_Download-1.1.0RC2.tgz ...
Starting to download HTTP_Download-1.1.0RC2.tgz (11,535 bytes)
.....done: 11,535 bytes
upgrade ok: channel://pear.php.net/HTTP_Download-1.1.0RC2
s1-iw:~# pear info HTTP_Download | grep PHP
Release License PHP
PHP >= 4.3.0
PHP >= 4.2.0
s1-iw:~# peardev install pecl/pecl_http
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
pear/pecl_http requires PHP (version >= 5.0.4, version <= 6.0.0), installed version is 4.3.10-15
No valid packages found
install failed
Could the differing main version of PHP be the cause for that?
And where does the "<= 6.0.0" dependency come from?
You have a package2.xml probably generated using pear convert with an older version of PEAR 1.4.0. The best thing to do is to go inside the package2.xml and find the dependencies section:
<dependencies>
...
<php>
<min>5.0.4</min>
<max>6.0.0</max>
</php>
...
</dependencies>
(ellipses [...] represent other stuff you shouldn't change, in case I'm being unclear)
and change it to:
<dependencies>
...
<php>
<min>4.3.10</min>
<exclude>5.0.0</exclude>
<exclude>5.0.1</exclude>
<exclude>5.0.2</exclude>
<exclude>5.0.3</exclude>
</php>
...
</dependencies>
This will have the desired effect of excluding PHP 5.x versions that are not compatible, while allowing everything else.
The optional="yes" stuff you're doing is a bit of a hack, at best. If those PHP versions may be fine, but are not recommended, then documentation is the place to inform the user. In other words, use package.xml to prevent the user from shooting themselves in the foot (and to reduce duplicate bogus bugs :), but use docs for any gray areas.
Hope this is helpful, let me know if I missed the point.
Greg