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

Bug #6383 incomplete PEAR::Error message on addReplacement()
Submitted: 2005-12-31 15:27 UTC
From: farell Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 4.4.0 OS: Windows XP
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 40 - 27 = ?

 [2005-12-31 15:27 UTC] farell
Description: ------------ Even if i've discovered this with a PFM2 1.6.0a4 script, i think it should concerned PEAR-core 1.4.5 due to share code. When i used a wrong/unkown replacement type i got an incomplete error message. Type known are: pear-config, package-info, php-const into class:PEAR_Task_Replace, method:validateXml See file: PEAR/Task/Replace.php Id: Replace.php,v 1.12 2005/10/02 06:29:39 cellog Exp at lines 91-92 return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'], array('pear-config', 'package-info')); it should be return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'], array('pear-config', 'package-info', 'php-const')); Tell me if i'm wrong ! Laurent PS: validation is done even if 'from' param is empty on a php-const replacement it could give something like with a valid php constant (PEARIX_DIR) <file baseinstalldir="/" md5sum="6d5139fc46bb46b3aa4be02b80ec46b9" name="itdynamic.html" role="doc"> <tasks:replace from="" to="PEARIX_DIR" type="php-const" /> </file> Is it a normal situation ? 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' => false ); $pkg = new PEAR_PackageFileManager2(); $pkg->setOptions($options); // general infos $pkg->setPackage($package); $pkg->setPackageType('php'); $pkg->setChannel(''); $pkg->setPearinstallerDep('1.4.3'); $pkg->setSummary($summary); $pkg->setDescription($description); $pkg->setLicense('PHP License 3.0', ''); // 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', ''); $pkg->addReplacement('advmultiselect.php', 'const', '@log_dir@', 'LOG_DIR'); $pkg->generateContents(); $pkg->debugPackageFile(); print 'still alive'; ?> Expected result: ---------------- PEAR_PackageFileManager2 Error: Replacement Type must be one of "pear-config, package-info, php-const", was passed "type: const" Actual result: -------------- PEAR_PackageFileManager2 Error: Replacement Type must be one of "pear-config, package-info", was passed "type: const"


 [2006-01-08 21:51 UTC] farell
Following Greg agreement, re-assign to PEAR-core. Laurent
 [2006-01-23 05:33 UTC] cellog
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.