Workaround for comment character conflict between python ConfigObj and PHP
This commit is contained in:
parent
04a1d82172
commit
75306936c0
3 changed files with 18 additions and 12 deletions
|
@ -91,7 +91,7 @@ class MediaSetup extends Setup {
|
|||
*/
|
||||
function moveAirtimeConfig() {
|
||||
return copy(AIRTIME_CONF_TEMP_PATH, self::AIRTIME_CONF_PATH)
|
||||
&& unlink(AIRTIME_CONF_TEMP_PATH);
|
||||
&& unlink(AIRTIME_CONF_TEMP_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue