strlen($property)) if ($property == substr($lines[$i], 0, strlen($property))){ $lines[$i] = "$property = $value\n"; } } $fp=fopen($filename, 'w'); for($i=0; $i<$n; $i++){ fwrite($fp, $lines[$i]); } fclose($fp); } static function UpdateIniFiles() { $api_key = AirtimeIni::GenerateRandomString(); AirtimeIni::UpdateIniValue('/etc/airtime/airtime.conf', 'api_key', $api_key); AirtimeIni::UpdateIniValue('/etc/airtime/airtime.conf', 'baseFilesDir', realpath(__DIR__.'/../../').'/files'); AirtimeIni::UpdateIniValue('/etc/airtime/pypo.cfg', 'api_key', "'$api_key'"); AirtimeIni::UpdateIniValue('/etc/airtime/recorder.cfg', 'api_key', "'$api_key'"); AirtimeIni::UpdateIniValue(__DIR__.'/../../build/build.properties', 'project.home', realpath(__dir__.'/../../')); } }