I am developing a install script like Magento for a Website, which can be re-used for future projects in CodeIgniter. The purpose of the install script is to create some tables and some basic data for the website such as site name, description, OG tags etc.
There is a prerequisite file say, install-prerequisite.php
by which the user will enter the database host, database username, database password and submit the credentials. The prerequisite is excluded from the CodeIgniter's index.php using .htaccess so as to exclude the database connection.
RewriteCond $1 !^(index\.php|install-prerequisite\.php|robots\.txt)
The values from the install-prerequisite.php has to be updated in database.php
of the CodeIgniter. This has also to be validated for successful connection too. Is this possible?
Similarly can the config.php
be edited by the data from the forms? User can edit the value for sess_cookie_name
, sess_expiration
etc. from a web page and update to the config.php
.
Synoptic:
- Update database.php parameters programmatically.
- Update config.php parameters programmatically.
- Check connection with parameters saved in database.php, from install.php.