Re: PEAR 1.4.0 dev UNOFFICIAL testing tarball available

From: Date: Mon, 24 May 2004 09:29:17 +0000
Subject: Re: PEAR 1.4.0 dev UNOFFICIAL testing tarball available
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29600@lists.php.net to get a copy of this message
This does not work, i tracked the error to line 1344 in ChannelFile.php is if (!$mirror) { should be if ($mirror) { Yavor Greg Beaver wrote:
Yavor Shahpasov wrote: I mixed my examples. to generate a channel file, just do something like <?php require_once 'PEAR/ChannelFile.php'; $pc = new PEAR_ChannelFile; $pc->setName('myname'); $pc->setSummary('mysummary'); $pc->setDefaultPEARProtocols(); $pc->setServer('myserver.com'); $fp = fopen('channel.xml', 'wb'); fwrite($fp, $pc->toXml()); fclose($fp); ?> the other script was for updating a *package.xml* and should have the starting lines <?php require_once 'PEAR/PackageFile.php'; $pc = new PEAR_PackageFile; .... Regards, Greg
<?php require_once 'PEAR/ChannelFile.php'; $pc = new PEAR_ChannelFile; $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'); $fp = fopen('package.xml', 'wb'); fwrite($fp, $pc->toXml()); fclose($fp); ?>
I get this error when trying this script Fatal error: Call to undefined method PEAR_ChannelFile::fromPackageFile() in F:\Documents and Settings\yavo\Desktop\PEAR_Channel\gen.php on line 4 It would be nice to have an example of a channel xml someware Yavor
-- Yavor Shahpasov yavo@siava.org Linux is not The Answer. Yes is the answer. Linux is The Question.

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