} } } if ($overwrite) { echo "* Creating INI files" . PHP_EOL; AirtimeIni::CreateIniFiles(); } AirtimeIni::CreateMonitFile(); AirtimeInstall::InstallPhpCode(); AirtimeInstall::InstallBinaries(); if ($overwrite) { echo "* Initializing INI files" . PHP_EOL; AirtimeIni::UpdateIniFiles(); } // Update the build.properties file to point to the correct directory. AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW . '/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW); require_once AirtimeInstall::GetAirtimeSrcDir() . '/application/configs/conf.php'; echo "* Airtime Version: " . AIRTIME_VERSION . PHP_EOL; AirtimeInstall::InstallStorageDirectory(); if ($db_install) { if ($newInstall) { // This is called with "system" so that we can pass in a parameter. See the file itself // for why we need to do this. system('php ' . __DIR__ . '/airtime-db-install.php y'); AirtimeInstall::DbConnect(true); } else { require_once 'airtime-db-install.php'; } } AirtimeInstall::CreateSymlinksToUtils(); AirtimeInstall::CreateZendPhpLogFile();
public static function MergeConfigFiles($configFiles, $suffix) { foreach ($configFiles as $conf) { if (file_exists("{$conf}{$suffix}.bak")) { if ($conf === CONF_FILE_AIRTIME) { // Parse with sections $newSettings = parse_ini_file($conf, true); $oldSettings = parse_ini_file("{$conf}{$suffix}.bak", true); } else { $newSettings = AirtimeIni::ReadPythonConfig($conf); $oldSettings = AirtimeIni::ReadPythonConfig("{$conf}{$suffix}.bak"); } $settings = array_keys($newSettings); foreach ($settings as $section) { if (isset($oldSettings[$section])) { if (is_array($oldSettings[$section])) { $sectionKeys = array_keys($newSettings[$section]); foreach ($sectionKeys as $sectionKey) { if (isset($oldSettings[$section][$sectionKey])) { AirtimeIni::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]); } } } else { AirtimeIni::UpdateIniValue($conf, $section, $oldSettings[$section]); } } } } } }