Workaround for comment character conflict between python ConfigObj and PHP

This commit is contained in:
Duncan Sommerville 2015-01-16 10:22:43 -05:00
parent 04a1d82172
commit 75306936c0
3 changed files with 18 additions and 12 deletions

View file

@ -40,7 +40,13 @@ abstract class Setup {
$inSection = false;
}
if ($inSection) {
if (substr(trim($line), 0, 1) == "#") {
/* Workaround to strip comments from airtime.conf.
* We need to do this because python's ConfigObj and PHP
* have different (and equally strict) rules about comment
* characters in configuration files.
*/
} else if ($inSection) {
$key = trim(@substr($line, 0, strpos($line, "=")));
$fileOutput .= $key && isset($properties[$key]) ? $key . " = " . $properties[$key] . "\n" : $line;
} else {