emoncms/emoncms — pull request #33 by Jerome-github (2013-03-02 17:27:00+00:00)
Title: Move config to settings.ini

Hi.

Currently, the settings are in settings.php, copied once from default.settings.php then user modified.

I would like emoncms to share at least the database settings with another application.

The reason for this is that I am working on a new RFM2Pi -> emoncms gateway [1], but that could be useful to any other application.

I could parse the php file, but that does not seem rational.

It makes more sense to me to move the configuration to an .ini file, shared between the php application and any other.

This is what this commit does.

I created default.settings.ini file to be copied as settings.ini

I modified settings.php to read the config in settings.ini

Please note that :

- menu_right is left untouched in settings.php : I did not know what to do with this. Is this meant to be modified by the user ? Or is it something that was meant to become a user parameter but never did ?

- settings.php and process_settings.php should probably be merged somehow, but I did not want to break anything. This can be done in a further step. Also,a little cleanup could be done in the strings about settings.php in */*/locale directories.

- We could move only DB settings but then that would mean two different files to copy/modify at configuration time.

- This pull request is not "git pull" safe : as it is, all user modified parameters will be lost, or more likely, the puller will be warned about a merge conflict, and a manual operation is needed.

What do you think about this proposal ?

Do you see any other way ?

Thanks

Jérôme

[1] The gateway is already quite functionnal. Just some remaining hardcoded parameters to deal with before the release :
https://github.com/Jerome-github/emoncms_raspberrypi/blob/raspberrypi_run_python_script/rfm2pigateway.py