function phpAds_ConfigFileUpdateFlush()
{
    global $phpAds_settings_update_cache;
    global $phpAds_settings_information;
    for (reset($phpAds_settings_update_cache); $key = key($phpAds_settings_update_cache); next($phpAds_settings_update_cache)) {
        phpAds_SettingsWriteAdd($key, $phpAds_settings_update_cache[$key]);
    }
    // Before we start writing all the settings
    // start with a clean config file to make
    // sure we always have the latest version
    phpAds_ConfigFileClear();
    // Now write all the settings back to the
    // clean config file
    return phpAds_SettingsWriteFlush();
}
                     phpAds_SettingsWriteAdd('tbl_session', $installvars['tbl_session']);
                     phpAds_SettingsWriteAdd('tbl_zones', $installvars['tbl_zones']);
                     phpAds_SettingsWriteAdd('tbl_config', $installvars['tbl_config']);
                     phpAds_SettingsWriteAdd('tbl_affiliates', $installvars['tbl_affiliates']);
                     phpAds_SettingsWriteAdd('tbl_images', $installvars['tbl_images']);
                     phpAds_SettingsWriteAdd('tbl_userlog', $installvars['tbl_userlog']);
                     phpAds_SettingsWriteAdd('tbl_cache', $installvars['tbl_cache']);
                     phpAds_SettingsWriteAdd('tbl_targetstats', $installvars['tbl_targetstats']);
                     phpAds_SettingsWriteAdd('admin_fullname', $installvars['admin_fullname']);
                     phpAds_SettingsWriteAdd('company_name', $installvars['company_name']);
                     phpAds_SettingsWriteAdd('admin_email', $installvars['admin_email']);
                     phpAds_SettingsWriteAdd('language', $installvars['language']);
                     phpAds_SettingsWriteAdd('admin', $installvars['admin']);
                     phpAds_SettingsWriteAdd('admin_pw', $installvars['admin_pw']);
                     phpAds_SettingsWriteAdd('url_prefix', $installvars['url_prefix']);
                     phpAds_ConfigFileClear();
                     if (!phpAds_SettingsWriteFlush()) {
                         $fatal[] = $strErrorInstallConfig;
                     }
                 } else {
                     $fatal[] = $strErrorInstallDatabase;
                 }
             } else {
                 $fatal[] = $strErrorInstallDbConnect;
             }
         } else {
             $fatal[] = $strConfigLockedDetected;
         }
         $phase = 5;
     }
 }
function phpAds_ConfigFileUpdateFlush()
{
    global $phpAds_settings_update_cache, $phpAds_settings_write_cache;
    global $phpAds_settings_information;
    foreach (array_keys($phpAds_settings_update_cache) as $key) {
        // Write old settings if they haven't been override
        if (!isset($phpAds_settings_write_cache[$key])) {
            phpAds_SettingsWriteAdd($key, $phpAds_settings_update_cache[$key]);
        }
    }
    // Before we start writing all the settings
    // start with a clean config file to make
    // sure we always have the latest version
    phpAds_ConfigFileClear();
    // Now write all the settings back to the
    // clean config file
    return phpAds_SettingsWriteFlush();
}