public function load_db_config($db_config, $force_config = false) { if ((bool) $force_config === true || !empty($_SESSION['db_config_set'])) { if (file_exists($db_config)) { $data_arr = array(); require $db_config; if (isset($data_arr) && count($data_arr) > 0) { $key_arr2 = array_keys($data_arr); foreach ($key_arr2 as $key2) { $reg_code = reg_data_source($key2, $data_arr[$key2]); if (!$reg_code) { $_SESSION[$key2]['handle'] = 0; } } $_SESSION['db_config_set'] = true; } else { trigger_error('Error: load_db_config(): No data sources defined!'); $_SESSION['db_config_set'] = false; } } else { trigger_error('Error: load_db_config(): Data Source Configuration file does not exist!'); $_SESSION['db_config_set'] = false; } } }
public function reg_data_source($ds_index, $ds_params) { reg_data_source($ds_index, $ds_params); }