On Mon, 8 Apr 2002, Marc Delisle wrote:
I am not against using functions, but:
- what about the existing arrays in config.inc.php3?
That is the reason I was using serialize and unserialize to store the data. Those functions preserve arrays perfectly.
- implementing pma_getvariable() all over the code will be a lot of
work, so I suggest before starting this, to think also about a possible User Preferences module (db-stored also).
Could we decide on which of the options in the current configuration should be available to each user in their personal preferences?
Since it will just be the redefinition of some of the options from the main configuration, I propose doing it like this:
Read in the master 'config_master' table. Read in a client override table 'config_user' which is contains all the fields of 'config_master' plus one additional field for the username. The options for 'config_user' are set over the existing 'config_master' options.
Voila! You have user preferences. But we would need to put some security on that 'config_user' table, as there are probably some things that we do not want the user being able to change.
Also, looking at the security functions of this, as well as the speed considerations, using a database configuration system will REQUIRE a system that supports sessions, otherwise you risk poor performance (re-reading the configuration data on each page). By using sessions, it could be loaded once on login, and then re-loaded if the user changes preferences.