Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.7.2

Bug #6379 Generic mapping role (*=>data) should exist for PFM1 and PFM2
Submitted: 2005-12-31 13:34 UTC
From: farell Assigned: farell
Status: Closed Package: PEAR_PackageFileManager
PHP Version: 4.4.0 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2005-12-31 13:34 UTC] farell
Description: ------------ When we remove all extension roles mapping we got Notice Errors. At least the generic mapping role '*' => 'data' should exists to avoid such problem. Actual solution to avoid problem programmers: 1. setOptions() with at least 'roles' => array('*' => 'data') 2. addRole('*', 'data') when 'roles' => array() Laurent Test script: --------------- <?php require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); // Package name and license used $package = 'HTML_QuickForm_advmultiselect'; // Full description of the package $description = <<<EOT The HTML_QuickForm_advmultiselect package adds an element to the HTML_QuickForm package that is two select boxes next to each other emulating a multi-select. EOT; // Summary of description of the package $summary = 'Element for HTML_QuickForm that emulate a multi-select.'; // Configuration of PEAR::PackageFileManager2 $options = array( 'packagefile' => 'package.xml', 'packagedirectory' => './pkg', 'filelistgenerator' => 'file', 'baseinstalldir' => 'HTML/QuickForm', 'changelogoldtonew' => false, 'simpleoutput' => true, 'roles' => array() // ('*' => 'data') ); $pkg = new PEAR_PackageFileManager2(); $pkg->setOptions($options); // general infos $pkg->setPackage($package); $pkg->setPackageType('php'); $pkg->setChannel('pear.php.net'); $pkg->setPearinstallerDep('1.4.3'); $pkg->setSummary($summary); $pkg->setDescription($description); $pkg->setLicense('PHP License 3.0', 'http://www.php.net/license/3_0.txt'); // release infos $pkg->addRelease(); $pkg->setAPIVersion('1.0.0'); $pkg->setAPIStability('devel'); $pkg->setReleaseVersion('0.1.0'); $pkg->setReleaseStability('alpha'); $pkg->setNotes('pfm2 bugs'); $pkg->setPhpDep('4.2.0'); $pkg->addMaintainer('lead', 'farell', 'Laurent', 'farell@php.net'); //$pkg->addRole('*', 'data'); $pkg->generateContents(); $pkg->debugPackageFile(); print 'still alive'; ?> Expected result: ---------------- Only PEAR_PackageFileManager2 Error: Package validation failed: error: tag <file> in context "<dir name="/">" has no attribute "role" ... Actual result: -------------- With option: simpleoutput = false Notice: Undefined index: * in [...]PEAR\PackageFileManager2.php on line 1243 With option: simpleoutput = true Notice: Undefined index: * in [...]PEAR\PackageFileManager2.php on line 1165 and additional output (as expected) PEAR_PackageFileManager2 Error: Package validation failed: error: tag <file> in context "<dir name="/">" has no attribute "role" ...

Comments

 [2006-01-09 11:04 UTC] farell
BTW this bug is also valid for PFM1. I'll fix it in CVS for both classes (PFM1 and PFM2) Laurent
 [2006-01-09 11:10 UTC] farell
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.