Global Configuration plugin
Global Configuration (global_config) is a plugin coded with the “optimization idea” in mind to simplify plugins configurations and files management. It is a configuration manager plugin. It also makes administrative tasks easier by enabling the use of a single configuration file for all your MyRoundcube plugins.
global_config plugin allows you to merge all plugins’ configurations into one single configuration file to minimize file stats. In short, it optimizes and reduces the load in your web server by centralizing and unifying plugins’ configuration files. The following is a vague idea of what it will do and how it is done: Every time users login into your Roundcube webmail interface, the server has to load each one of your plugin’s configuration files. Hence it is fair to say that having at least 20 plugins in your webmail installation will simply have the server reading and delivering 20+ configuration files. This happens on every single click/login or other user interaction with your server. Taking only these numbers into account we can say that to serve 50 users your server will need to reach 20 plugins’ config x 50 users = 1000 files on a single action such as login into your webmail.
What happens in the case of global_config being used?
Following the same previous math calculation (which a caveman could do it) global_config is a single file with all your plugins’ configurations in it. Hence we could assume that the same amount of users, 50 in this case, will only have to be served 50 configuration files on a similar action such as login into your webmail. 1 x 50 = 50. Think about 50 requests vs 1000 requests (file stats) in a production environment with 500, 1000, 5000 users and you will soon realize how stressing this could be for a web server, no exceptions.
global_config is the only plugin that should be registered in …/config/main.inc.php along with plugin_manager (if using plugin_manager) with your MyRoundcube plugins. No other plugin from our bundle should be registered in the main configuration file when using plugin_manager. See also plugins installation section.
Make a copy of …/plugins/global_config/config.inc.php.dist into that same directory and rename the new file to config.inc.php. Open this .php file just so you become familiar with it. It should be empty by default – see screenshot on your right.
Copy the config.inc.php.dist contents of the plugin you would like to enable/register in your Roundcube installation into …/plugins/global_config/config.inc.php
e.g.: Let’s register archivefolder plugin in our installation:
- Copy its content into the …/plugins/global_config/config.inc.php configuration file you created at the beginning of this tutorial- see screenshot on your right.
Congratulations! You have now configured archivefolder and it is enabled in your Roundcube webmail installation.
Follow the same procedure to enable/register MyRoundcube plugins in your Roundcube webmail when using global_config.
global_config and plugin_manager explainedGlobal_config plugin is rather simple to work with once you understand its dynamic. To get global_config and plugin_manager working together you must first configure global_config plugin:
Make a copy of …/plugins/global_config/config.inc.php.dist in the same directory and rename the new file to config.inc.php. Again, open this new .php file just so you become familiar with it. It should be empty by default. Familiar enough?
Since …/plugins/global_config/config.inc.php file is empty by default, registering this plugin will load ermm… nothing. In fact, it will prevent plugin_manager from loading too. That’s both, unwelcome and expected. So let’s give it a proper configuration before registering it:
1- When configuring global_config, start by opening and copying …/plugins/plugin_manager/config.inc.php configuration or …/plugins/plugin_manager/config.inc.php.example configuration (which holds the complete configuration for every MyRoundcube plugin) into …/plugins/global_config/config.inc.php.
2- In the same way you copied plugin_manager configuration into …/plugins/global_config/config.inc.php, copy the configuration of all other MyRoundcube plugins in your installation. To do so, you will browse to the plugin’s folder in question, open/edit the config.inc.php.dist file and add it to …/plugins/global_config/config.inc.php. Doing so for the first time takes some time, no doubt. Be persistent and get it done!
Now that you have copied plugins configurations into …/plugins/global_config/config.inc.php it is worth mentioning that you no longer need to create a config.inc.php file for separate for each one of your plugins, not you want to register them in …/config/main.inc.php, with the exception of global_config and plugin_manager:
... // Make sure global_config is registered before plugin_manager// // List of active plugins (in plugins/ directory) $rcmail_config['plugins'] = array('global_config','plugin_manager'); ...
You should have a fully working global_config with plugin_manager in your Roundcube installation by now. Happy Roundcubing!