Re: PEAR 1.4.0dev3 is available

From: Date: Sun, 30 May 2004 22:04:33 +0000
Subject: Re: PEAR 1.4.0dev3 is available
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29807@lists.php.net to get a copy of this message
Hi Mika, Thanks for your extra work. I guarantee the first alpha will be a LOT easier to use and will be documented properly so that people can test it. devel is as devel happens, of course :). Aside from the issues below, how do things shape up? Some of the other problems killed? Mika Tuupola wrote:
On Sun, 30 May 2004, Mika Tuupola wrote:
Anyway, does anyone on the list info on how the new package.xml with channels should look like. Running the following script:
I guess I figured it out. The example script did not initialize PEAR_Registry object for PEAR_PackageFile. Also setPackagexmlVersion('1.1') does not seem to work. If the original package.xml has <package version="1.0"> the output will also have 1.0 regardless the setPackagexmlVersion('1.1').
I have to admit that I didn't test this very thoroughly - I guess some debugging is in order :)
If I am correct the only needed changes to package.xml to have channels support are the following: 1) package must have attribute 'version' with value 1.1 <package version="1.0">
correct except (of course) s/1.0/1.1
2) name must have attribute 'channel' with desired channel name <name channel="channelname">Foo_Bar</name>
channel is not required, it defaults to "pear" if not present. If the package version is 1.1, the PackageFile object will automatically put in an explicit channel="pear" to avoid future ambiguity.
Below is a working version of the example conversion script. However atleast in my case i had to have <package version="1.1"> already in the package.xml for it to do anything (basically adds the default channel 'pear' to the name tag. Creg correct me if I'm wrong).
That will work very nicely. Thanks for the PEAR_Registry thing, I haven't tested the example script, glad you could figure this one out :) Greg
-cut- <?php require_once 'PEAR/Common.php'; require_once 'PEAR/PackageFile.php'; require_once 'PEAR/Registry.php'; $pr = new Pear_Registry(); $pc = new PEAR_PackageFile(); $pc->setRegistry($pr); $err = $pc->fromPackageFile('package.xml'); if (PEAR::isError($err)) {
     die($err->getMessage());
} foreach ($pc->getErrors(true) as $error) {
     echo ucfirst($error['level']) . ': ' . $error['message'] . "\n";
} if (!$err) {
     die('Validation failed');
} $pc->setPackagexmlVersion('1.1'); // does not work? print $pc->toXML(); ?> -cut-


« previous php.pear.dev (#29807) next »