Hello, I got the following scenery:
My app receives an authenticated user from another external app. When the user comes to my app I must to set some session vars like: user_id, account, database, etc.
My big problem is: Codeigniter by default initializes database settings when the library is called from autoload file. I would like to load database settings from an specific file, something like: config/database/database1.php, config/database/database2.php, etc., because will be used many databases.
I'm not an expert programmer, I can do some ugly hacks with cookies or php native sessions but I think that's not right.
I've tried some hooks like this (pre_controller):
PHP Code:
$database = $ci->session->userdata('database');
$ci->load->database($database, TRUE);
But it does not works for me. Any help or advice?
Sorry for my bad english, thanks.