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

Bug #4623 Apache container breaks on sections with arguments
Submitted: 2005-06-17 23:15 UTC Modified: 2006-12-16 07:57 UTC
From: matt at conundrum dot com Assigned: aashley
Status: Closed Package: Config
PHP Version: 4.3.11 OS: any
Roadmaps: (Not assigned)    
Subscription  


 [2005-06-17 23:15 UTC] matt at conundrum dot com
Description: ------------ the Apache container is unable to handle standard apache sections which contain arguments, such as <Virtualhost foo.com> or <Directory /path> for example, given the file "test_in.conf": <VirtualHost 127.0.0.1> ServerName www.foo.com </VirtualHost> <Directory /path/to/foo> Limit GET </Directory> Reproduce code: --------------- <?php require_once('Config.php'); $conf = new Config; $root =& $conf->parseConfig('./test_in.conf', 'Apache'); echo $root->toString('Apache' ); $conf->writeConfig('./test_out.conf', 'Apache' ); ?> Expected result: ---------------- <VirtualHost 127.0.0.1> ServerName www.foo.com </VirtualHost> <Directory /path/to/foo> Limit GET </Directory> test_out.conf should be identical to test_in.conf Actual result: -------------- <VirtualHost 127.0.0.1> ServerName www.foo.com </VirtualHost> <Directory /path/to/foo> Limit GET </Directory> test_out.conf is missing data: <VirtualHost> ServerName www.foo.com </VirtualHost> <Directory> Limit GET </Directory> Given that the toString output is correct, but the data saved to test_out.conf is not, I suspect the problem is in writeConfig

Comments

 [2005-12-19 03:03 UTC] aashley at php dot net
Problem is related to use of each in Config_Container_Apache::toString(). You would experience the same problem doing: echo $root->toString('Apache' ); echo $root->toString('Apache' ); Replaced it with a foreach to fix problem. http://www.adamashley.name/stuff/config-apache-container.patch
 [2005-12-23 21:34 UTC] aashley at php dot net
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.