Re: subpackages and bundles

From: Date: Fri, 04 Jun 2004 01:01:43 +0000
Subject: Re: subpackages and bundles
References: 1  Groups: php.pear.core 
Request: Send a blank email to pear-core+get-365@lists.php.net to get a copy of this message
Greg Beaver wrote:
Hi, This gives me an idea of how to implement subpackages and also the bundle idea that has been mentioned by a number of developers. First of all, there are 2 different kinds of sub-packages: - sub-packages recognized by the primary package and needed for operation - sub-packages that are not essential to the primary package, but must be uninstalled when the primary package is uninstalled, or upgraded with the primary package. Even now, this sequence: $ pear upgrade PEAR Error: requires Console_Getopt >= 1.2 $ pear upgrade Console_Getopt PEAR is kind of annoying. Console_Getopt should always be upgraded if a higher version is required by PEAR, it is not really separate from PEAR.
I'm not with you here. If I'm using Console_Getopt in production and know the next version breaks my app, I don't want to see automatic upgrade. If I'm sure there is your nice "-a|--alldeps".
package-level bundles would be defined in package.xml for a package <bundles> <bundle type="default"> <!-- default install on "pear install/upgrade PEAR" --> <subpackage type="pkg">Console_Getopt</subpackage> <subpackage type="pkg">PEAR_ErrorStack</subpackage> <bundle> <bundle type="custom" name="minimal"> <subpackage type="pkg">Console_Getopt</subpackage> <bundle> <bundles>
I won't go that far. With that, you require from the user to know what packages bundles (pear list-bundles?) and to analyze what set of them is best for me (please don't tell me disk space). I'd preffer just: <bundle type="pkg">Console_Getopt-1.2.tgz</bundle> Even maybe: <bundle type="bundle">PEAR-1.3.tgz</bundle> Anyway, bundling would be cool if bundled packages could be installed at the parent package space, ex: <php_dir>/PEAR/Console/Getopt.php, but that's not possible with out current dir layout. In this case I see no benefit.
The second kind of subpackage is exemplified by HTML_QuickForm_Controller. HTML_QuickForm does not care whether or not it is installed or doesn't exist, but HTML_QuickForm_Controller must be uninstalled with HTML_QuickForm, or may need upgrading. $ pear uninstall HTML_QuickForm HTML_QuickForm_Controller depends on HTML_QuickForm, failed. $ pear uninstall HTML_QuickForm HTML_QuickForm_Controller This kind of child->parent relationship could be noted in the package.xml as well: <package version="1.1"> <name channel="pear" parent="HTML_QuickForm">HTML_QuickForm_Controller</name> This would instruct the installer to uninstall HTML_QuickForm_Controller if passed the --subpackages switch $ pear uninstall --subpackages HTML_QuickForm uninstall of HTML_QuickForm_Controller OK uninstall of HTML_QuickForm OK I think these two solutions: 1) package-level bundles for top-down subpackages 2) parent specification for bottom-up subpackages
For 1), the idea is nice, but I don't see the need for 2), a simple "has" dep is enough. Maybe you can think a case I'm missing.
will solve the subpackage dilemma and allow supreme modularization of packages. All drivers for DB/MDB could become separate subpackages that could also be specified as bundles, templates like Flexy could split off the compilation code to allow a minimal Savant-like configuration, and application support would not be far off, especially since the bundle attribute could specify packages from other channels as part of the bundle.
This stuff makes a lot of sense if the pear web treats subpackages inside the parent package page. So it could list diferent maintainers for different subpackages and split bugs, etc. But imho that's a mess, each package release will need a high QA effort for selecting what versions works better with what subpackages, or people installing drivers that don't work with its current "core", etc. Haven't yet seen a real need for subpackages, please prove me the contrary :)
Once bundles/subpackages are in place, the only thing missing for true app support is some kind of customizable task support, in order to do things like initialize databases, set up writable data locations, and configure application frontends like web interfaces and so on. :)
That's the easy part, just a pre and post call to a php script, AFAIR that was even supported (not handled) by the package.xml parser. If we want to be kind we could provide some functions to common tasks. Tomas V.V.Cox

« previous php.pear.core (#365) next »