I am trying to add the config statements using code into config->database.php, how to add statements to the config file and create a new connection group each time a tenant is registered. How to write to a file in codeigniter ?
I want to add the below statements dynamically to database.php once a tenant is created:
$db['uup']['hostname'] = 'localhost';
$db['uup']['username'] = 'root';
$db['uup']['password'] = '';
$db['uup']['database'] = 'uup';
$db['uup']['dbdriver'] = 'mysql';
$db['uup']['dbprefix'] = '';
$db['uup']['pconnect'] = TRUE;
$db['uup']['db_debug'] = TRUE;
$db['uup']['cache_on'] = FALSE;
$db['uup']['cachedir'] = '';
$db['uup']['char_set'] = 'utf8';
$db['uup']['dbcollat'] = 'utf8_general_ci';
$db['uup']['swap_pre'] = '';
$db['uup']['autoinit'] = TRUE;
$db['uup']['stricton'] = FALSE;
</div>