I need to change the db name for particular login in (parameter . ini file) in symfony 2.0. So i tried in session .But it is not working .Is it possible to put session value in parameter . ini file ?
My code: (parameter . ini File)
<?php
session_start();
$dbnamenew='';
if($_SESSION['test_db']!=""){
$dbnamenew=$_SESSION['test_db'];
}
else {
$dbnamenew ='test';
}
?>
; These parameters can be imported into other config files
; by enclosing the key with % (like %database_user%)
; Comments start with ';', as in php.ini
[parameters]
database_driver="pdo_mysql"
database_host="localhost"
database_port="22"
database_name="<?php echo dbnamenew;?>"
database_user="user"
database_password="pass"
mailer_transport="smtp"
mailer_host="localhost"
mailer_user=""
mailer_password=""
locale="en"
secret="b538e3680321a85b2e39a3d1772e0b711ff9371c"