Re: official docs for package.xml 2.0 will be on pear.php.net tomorrow
| From: | Greg Beaver | Date: | Tue, 22 Mar 2005 00:10:03 +0000 |
| Subject: | Re: official docs for package.xml 2.0 will be on pear.php.net tomorrow | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2195@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
Hi Sara, That's a neat idea. My only concern with your suggestion is the security of allowing arbitrary code execution, considering that channels allow anybody to set up a channel server. Some shmuck might distribute hostile code through PHP in the midst of "checking" dependencies. I moved post-install scripts outside of automatically running during installation for that reason. I wonder if it would be enough for your needs to implement something like an <or> tag and perhaps a <set> tag? <or> <set> <php> <min>5.1.0</min> </php> <extension> <name>zlib</name> </extension> </set> <set> <php> <min>5.0.0</min> </php> <package> <name>zlib_filter</name> <channel>pecl.php.net</channel> <providesextension>zlib_filter</providesextension> </package> </set> </or> In English, this would read as "either set 1 or set 2 must be installed. set 1 is php 5.1.0+ with zlib extension enabled. set 2 is php 5.0.0+ with the zlib_filter package or extension installed" Unfortunately, this would result in some serious complexity. I don't know if you've been following pear-dev, but devs are complaining because PEAR 1.4 is weighing in at about 8-15 MB per run depending on what you're doing with it. Supporting this syntax would add another MB or so, I would imagine. I'm open to other ideas. Maybe a feature dependency, with types <stream>, <function>, <class>? <feature> <stream>zlib.inflate</stream> <failmessage>Install pecl.php.net/zlib_filter, or compile PHP 5.1.0 with zlib</failmessage> </feature> Greghttp://pear.php.net/manual/en/guide.developers.package2.phpI like the improvements to the dependencies section and the "provides" references. One thing I'd like to see, possibly in the next revision, is a means to specify a more complex dependency. For example, the zlib.deflate:// and zlib.inflate:// stream filters can be provided by *either* PHP >= 5.1.0 (with the zlib extension enabled) or by PECL/zlib_filter in PHP 5.0.x. What seems the most flexible to me, would be an ability to fork out a php script (similar to SKIPIF in a phpt) to return a list of dependent packages which should be installed in order to continue, or return a numeric exit code of 0 for a "sufficient" environment, or -1 for a complete inability to meet requirements without upgrading PHP: <dependencies> <run shell="php" script="depcheck.php"/> </dependencies> depcheck.php: <?php if (version_compare(php_version(), "5.1.0") >= 0) {if (extension_loaded('zlib')) { die(0); } else { die('zlib'); }} if (extension_loaded('zlib_filter')) die(0); if (version_compare(php_version(), "5.0.0") < 0) die(-1); die('zlib_filter'); ?>