symfony 2.0 では、特定のログイン (パラメータ .ini ファイル) のデータベース名を変更する必要があります。だから私はセッションで試しました.しかし、それは機能していません.パラメータにセッション値を入れることは可能ですか. iniファイル?
私のコード: (パラメータ .ini ファイル)
<?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"