Re: bundles
| From: | Stig S. Bakken | Date: | Tue, 14 Sep 2004 21:21:57 +0000 |
| Subject: | Re: bundles | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33375@lists.php.net to get a copy of this message | ||
On Mon, 2004-09-13 at 09:27, Lukas Smith wrote:
> Let me brainstorm some related topics. Currently we have alot of
> packages that support different backends, optional security improvements
> etc. Especially for the different (database) backends alot of packages
> already support 3 difference abstraction layers and usually users only
> want one. So for that users will eventually be able to select what they
> want at install time. Now the question is if we want to enable users to
> set those selections globally similar to how gentoo allows you to. So
> setting the global option "DB" would set the "only install the DB
> backend if relevant" for every package being installed.
There is a "provides feature" thingie in package.xml that can be used to
express meta-functionality. The idea is stolen^Wborrowed from rpm,
where you can specify a dependency like "this package needs a web
server", rather than "this package needs apache".
For example, you have a package that requires _some_ template package.
It has support for a bunch, but it requires at least one of them to be
installed. I never got around to implementing this fully, but the idea
is this:
<deps>
<dep type="feature" name="template-system"/>
<dep type="pkg" optional="yes" name="HTML_Template_IT"/>
<dep type="pkg" optional="yes" name="HTML_Template_Flexy"/>
<dep type="pkg" optional="yes" name="HTML_Template_Foobar"/>
</deps>
This requires that all of the template packages package.xml file
contains:
<provides type="feature" name="template-system"/>
It also requires some discipline in naming features, that'd have to go
into some standard or registration process.
This way, the list of dependencies above defines a set of options for
some type of functionality. For PHP 5 it's logical to add an
"interface" dependency/provides option, so you can do:
<deps>
<dep type="interface">Template</dep>
</deps>
Since the interface is well-defined, you don't need to specify which
implementations are supported like in the first example. The pear
server would know which package(s) provide which interfaces.
- Stig