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

Bug #12387 GenericConf doesn't allow for hyphens on left-hand-side of a directive
Submitted: 2007-11-06 04:53 UTC
From: paleozogt Assigned: cweiske
Status: Closed Package: Config (version 1.10.11)
PHP Version: 4.4.7 OS: irrelavent
Roadmaps: (Not assigned)    
Subscription  


 [2007-11-06 04:53 UTC] paleozogt (Aaron Simmons)
Description: ------------ The GenericConf format doesn't allow hyphens on the LHS of a directive. For example, this is valid: key_word:value but this is not key-word:value The underscore is allowed because the regexp used is "\w", which includes alphanumeric and underscores. To support hyphen, a hyphen must be explicitly included in the regexp. Test script: --------------- function demobug() { // this will fail unless you remove the hyphen $configtext= "key-word:value"; $testfile="/tmp/testconfig.conf"; $file = fopen($testfile, "w"); fwrite($file, $configtext); fclose($file); $c = new Config(); $conf=& $c->parseConfig($testfile, "GenericConf"); echo $conf->toString('GenericConf', $options); } Expected result: ---------------- it should display, "keyword:value" Actual result: -------------- it displays, "[pear_error: message="Syntax error in '/tmp/testconfig.conf' at line 1." code=0 mode=return level=notice prefix="" info=""]"

Comments

 [2010-12-21 02:42 UTC] cweiske (Christian Weiske)
I think the expected output is "key-word:value"
 [2010-12-21 02:51 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Closed -Assigned To: +Assigned To: cweiske
This bug has been fixed in SVN. 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.