From b91adfb3aac70a8bf59238402f766e68f56db754 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 30 Mar 2011 13:53:48 -0400 Subject: [PATCH] -Airtime.ini should follow PHP coding guidelines more closely. --- install/include/AirtimeIni.php | 79 ++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/install/include/AirtimeIni.php b/install/include/AirtimeIni.php index 8a5071392..33e7f772e 100644 --- a/install/include/AirtimeIni.php +++ b/install/include/AirtimeIni.php @@ -1,4 +1,10 @@ strlen($property)) - if ($property == substr($lines[$i], 0, strlen($property))){ - $lines[$i] = "$property = $value\n"; + if (strlen($lines[$i]) > strlen($p_property)) + if ($p_property == substr($lines[$i], 0, strlen($p_property))){ + $lines[$i] = "$p_property = $p_value\n"; } } - $fp=fopen($filename, 'w'); + $fp=fopen($p_filename, 'w'); for($i=0; $i<$n; $i++){ fwrite($fp, $lines[$i]); } fclose($fp); } + /** + * After the configuration files have been copied to /etc/airtime, + * this function will update them to values unique to this + * particular installation. + */ static function UpdateIniFiles() { $api_key = AirtimeIni::GenerateRandomString();