Re: Re: Conditional package dependencies?
| From: | Olivier Guilyardi | Date: | Mon, 11 Jun 2007 17:55:36 +0000 |
| Subject: | Re: Re: Conditional package dependencies? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47010@lists.php.net to get a copy of this message | ||
Hi Greg,
Greg Beaver wrote:
> Mark Wiesemann wrote:
>> To keep it short: Is there a way to define a conditional dependency that
>> requires the new driver if PHP 5 is used, and that defines only an
>> optional dependency if PHP 4 is used?
>
> There is one possibility that may be a bit onerous. Basically, your
> only hope is to take advantage of the new pre-download PHP dependency
> resolution in PEAR 1.6.0.
Okay, so we need to require PEAR >= 1.6.0
> What you could do is have the 1.0.x versions of SQLQuery driver simply
> be a wrapper for the default php 4 driver, and 1.1.x versions of
> SQLQuery driver be the php 5 driver. However, for this to work, you'd
> need the API to be BC between 1.1.x and 1.0.x. If the php4/php5
> machinations are all under the hood, this solution would actually work
> and satisfy PEAR's API BC requirements
If I understand correctly you mean that:
- SDG_DS_SQLQuery 1.0.x wouldn't provide any file by its own but depend on:
- PHP4
- SDG_DS_DBQuery (the old DB-based driver)
- SDG_DS_MDB2 (the old MDB2-based driver)
- SDG_DS_SQLQuery 1.1.x would provide the new driver's files and depend on:
- PHP5
- Structures_DataGrid would depend on:
- SDG_DS_SQLQuery >= 1.0
Then the pear installer would download the 1.0.x version if it detects PHP4, and
the 1.1.x or later version otherwise. Is this right?
It seems to me like it wouldn't create any maintaining overhead.. That seems to
be the perfect solution :)
Regards,
--
Olivier