strlen($p_property)) if ($p_property == substr($lines[$i], 0, strlen($p_property))){ $lines[$i] = "$p_property = $p_value\n"; } } $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(); AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_AIRTIME, 'api_key', $api_key); AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_AIRTIME, 'base_files_dir', realpath(__DIR__.'/../../').'/files'); AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_AIRTIME, 'airtime_dir', realpath(__DIR__.'/../../')); AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_PYPO, 'api_key', "'$api_key'"); AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_RECORDER, 'api_key', "'$api_key'"); AirtimeIni::UpdateIniValue(__DIR__.'/../../build/build.properties', 'project.home', realpath(__dir__.'/../../')); } }