Opened 3 years ago
Last modified 5 days ago
#1487311 new Feature Requests
Merge config files
| Reported by: | thomasb | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 1.0-beta |
| Component: | Core functionality | Version: | 0.5-beta |
| Severity: | normal | Keywords: | config |
| Cc: | arthur@…, ck@… |
Description
There's no rational reason why to have the configuration for database access in a separate file. Both config files should be merged together and only contain non-default settings. The distribution should contain a defaults.inc.php file which is loaded before the local config file providing all the defaults.
Change History (14)
comment:1 Changed 3 years ago by alec
comment:2 Changed 2 years ago by thomasb
I don't agree with putting configuration into database. Config files are good enough and they can even be modified with an admin interface. Other projects such as phpMyAdmin use a default config file and the local file only defines options which differ from defaults. Currently we need to copy the entire config file(s) and it's hard to bring in new config options. As an alternative to a default config file we could also define defaults within the code when using rcube_config::get() but I'd prefer to have them in a central place.
comment:3 Changed 2 years ago by thomasb
Marked #1487844 as duplicate of this ticket. We should also consider the following suggestion from that ticket:
I'd also like the ability to define *where* this local config file might reside... ie, by default look in the current directory (where main.inc.php is), then, if $local_config_dir (or whatever) is set, look there (ie, /etc/roundcube)...
comment:4 Changed 2 years ago by vminakov
Suggestion:
look at the Zend_Config component and how it handles config overrides. You can easily define default settings and overrides for every environment you like. In respect to roundcube, it could look like this:
main.inc.php - default settings main.live.inc.php - Configuration for 'live' environment. Extends default settings, overrides what needed main.dev.inc.php - Configuration for 'dev' environment. Extends live, overrides what needed main.staging.inc.php - Configuration for 'staging' platform. Extends whatever is needed. ...
During the bootstrap process, include and parse main.inc.php file. Thereafter, depending on environment include and parse main.ENVIRONMENT.inc.php as well. ( (e.g. if a special environment variable is set to 'live', include main.live.inc.php)
Benefit of this approach is very easy deployment. Nothing should be done, when users are upgrading roundcube. And allows deployment automation with phing, ant or any other tool.
comment:5 Changed 19 months ago by thomasb
- Milestone changed from 0.7-stable to 0.8-beta
comment:6 Changed 15 months ago by thomasb
- Milestone changed from 0.8-rc to 0.9-beta
comment:7 Changed 7 months ago by roentgen
- Cc arthur@… added
comment:8 Changed 6 months ago by alec
With this change I propose to also rename $rcmail_config variable to $config for naming consistence with Roundcube Framework.
comment:9 Changed 6 months ago by Napsty
- Cc ck@… added
comment:10 Changed 5 months ago by thomasb
- Milestone changed from 0.9-stable to 1.0-beta
Some discussion and proposals from the dev mailing list: http://lists.roundcube.net/pipermail/dev/2013-January/022188.html
comment:11 Changed 3 months ago by thomasb
And replace db_table_* config options with one single db_tablename_prefix option.
comment:12 Changed 8 weeks ago by alec
db_prefix option implemented in 399db1b647e14947e97a865c09215969f56a7efe.
comment:13 Changed 3 weeks ago by thomasb
Consider changes proposed in https://github.com/roundcube/roundcubemail/pull/73
comment:14 Changed 5 days ago by alec
Config files merge done in dev_config branch.

I think, we should move configuration to the database. In (one small) config file we should have only database settings. The rest of config can be in database. Of course, for better performance we could cache config in a local file. This will also require an admin interface for configuration management.
I'm not sure, we need a file with defaults.