Re: Re: nested package dependencies
| From: | Justin Patrin | Date: | Mon, 07 Feb 2005 17:41:28 +0000 |
| Subject: | Re: Re: nested package dependencies | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36012@lists.php.net to get a copy of this message | ||
On Mon, 07 Feb 2005 12:42:47 -0500, Greg Beaver <cellog@php.net> wrote:
> Andrew Nagy wrote:
> > Hello all, I was wondering about the ability to have nested package
> > dependencies?
> >
> > For example, the Structures_DataGrid package offers HTML output with the
> > usage of the HTML_Table package in conjunction with output from Pager.
> > However, If the user opts to not use the HTML output (for example they
> > want to output the grid in excel), they do not need these 2 packages and
> > are therefor listed as optional in the package.xml file. However, if I
> > do use the HTML output, I MUST have Pager installed.
> >
> > So instead of having this:
> > <dep type="pkg" rel="ge" version="1.2"
> > optional="no">PEAR</dep>
> > <dep type="pkg" rel="ge" version="1.5"
> > optional="yes">HTML_Table</dep>
> > <dep type="pkg" rel="ge" version="2.2.5"
> > optional="yes">Pager</dep>
> >
> > I would like to be able to do something like this:
> >
> > <dep type="pkg" rel="ge" version="1.2"
> > optional="no">PEAR</dep>
> > <dep type="pkg" rel="ge" version="1.5"
> > optional="yes">HTML_Table
> > <dep type="pkg" rel="ge" version="2.2.5"
> > optional="no">Pager</dep>
> > </dep>
> >
> > If their is no current way to do this, could we implement a new version
> > of the package XML to support this syntax, or a cleaner syntax might be:
> >
> > <dep type="pkg" rel="ge" version="1.2"
> > optional="no" title="PEAR" />
> > <dep type="pkg" rel="ge" version="1.5"
> > optional="yes" title="HTML_Table">
> > <dep type="pkg" rel="ge" version="2.2.5"
> > optional="no" title="Pager" />
> > </dep>
>
> It's funny you should ask about this as PEAR 1.4.0a1 nears readiness :)
>
> I realized that this exact situation would be necessary sooner rather
> than later, and this is the reason I implemented dependency groups in
> package.xml 2.0.
>
> Dependencies in package.xml 2.0 are grouped slightly differently. There
> are 3 kinds of dependencies. Required, optional, and optional groups.
> The optional groups stick several dependencies together as if they were
> a single dependency, so that you can install a single feature, such as
> the HTML_Table/Pager feature. All packages have to list a minimum AND
> mamximum required php version (use 6.0.0 if you're sure it works with
> 5.x) and minimum required PEAR installer version (this one is so that
> people can depend on a newer version of the installer without having to
> have a package dependency on PEAR).
>
> <dependencies>
> <required>
> <php>
> <min>4.2.0</min>
> <max>6.0.0</max>
> </php>
> <pearinstaller>
> <min>1.4.0a1</min>
> </pearinstaller>
> </required>
> <group name="htmltable" hint="Paged output using HTML_Table">
> <package>
> <name>HTML_Table</name>
> <min>1.5</min>
> </package>
> <package>
> <name>Pager</name>
> <min>2.2.5</min>
> </package>
> </group>
> </dependencies>
>
> To install, the user simply goes:
>
> $ pear install Structures_DataGrid#htmltable
>
> and even better, to uninstall both packages in this optional feature:
>
> $ pear uninstall Structures_DataGrid#htmltable
>
:-) I forgot about those features. I have to hand it to you. You've
done a great job expanding and improving (and bugfixing :-)) the PEAR
installer. My hat's off to you.
--
Justin Patrin