CodeIgniter Forums

Full Version: Generating Database Configuration File
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,


I'm developing a web application like erp with crm's features, I would like to automate the process generating the config.php and database.config files, on my web application. I thought to create kind of a step-by-step installation like joomla installations. Have you some tip for do it?
Have you though about .env files? You can generate them relatively easy and load them with PHP getenv function.

Check this out: https://github.com/josepostiga/Codeigniter-env-support
(03-31-2016, 01:20 PM)josepostiga Wrote: [ -> ]Have you though about .env files? You can generate them relatively easy and load them with PHP getenv function.

Check this out: https://github.com/josepostiga/Codeigniter-env-support

The problem isn't to identify the environment of application, the main problem how I should create a step-by-step installation (please enter with database server...,enter with your database user...., enter your database password..., please enter with your url of site...) then confirm this fields for example, the application will be put this information in files config.php and database.php.
The link I gave you is not to identify the environment of the application, but to load the configuration without being messing around with the config files directly. Also, you could create a system hook to check for that .env file existence and/or it's structure to know if you should redirect the request to a install controller.

That controller is the one who handles that installation process. You could create a method for each necessary step (app config, db config, etc).