How To Write Config Main.php Dynamically

How to write config main.php dynamically ?

What’s your specific purpose?

i m going to create installer wizard for my application.

User will download product and configured by there end.

so whatever they post in installtion step like Database inforamtion, site title, FTP details etc.

i need to write those user input in there main.php.

Hope you got my point.

Thanks for reply,

Set db like this in main.php

‘db’=>(defined(‘DB_CONNECTION’) ? array(

                'connectionString'=>DB_CONNECTION,


                'username'=>DB_USER,


                'password'=>DB_PWD,


                'charset'=>'utf8',


                'emulatePrepare' => true,


                'enableParamLogging'=>true,


            ) : array()),

and define variables in another file(installer.php) and merge with main.php .

On installation get the values and write it installer.php .