Summary | Allow conf.d style directory configuration overriding |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Enhancement |
State | Assigned |
Priority | 1. Low |
Owners | wrobel (at) horde (dot) org |
Requester | math.parent (at) gmail (dot) com |
Created | 04/09/2009 (5879 days ago) |
Due | |
Updated | 03/07/2010 (5547 days ago) |
Assigned | 01/12/2010 (5601 days ago) |
Resolved | |
Milestone | |
Patch | No |
Exceptions not PEAR errors (Ticket #8172).
http://git.horde.org/diff.php/framework/Core/lib/Horde.php?rt=horde-git&r1=837be59133c0b29f14d5b97f5a187685dbc1be85&r2=c2d8b814fdfb9bdddd98b1396da1c5d59d625dfc
Update CHANGES for ticket #8172
http://git.horde.org/diff.php/horde/docs/CHANGES?rt=horde-git&r1=2c85abba6e6b4677ffd5c43a0ddb62936f374f9d&r2=442c4ced45a7f25adda4fb54146a9ccea2837188
gets displayed in case the conf.d directory holds php-files. It
should indicate that there are files present that override settings
visible in the admin view.
If a distribution uses the "conf.d" directory in order to override
settings from "conf.php" and has the admin section enabled then it
might be confusing to the admin user that setting certain values in
the admin interface seem to have no effect.
On the one hand the admin section does not read more than the conf.php
file. So anything that is set in conf.d will not be displayed in the
admin section. And if you change a value that is being overwritten in
conf.d then changing it has no effect.
I would suggest that we add a notification in the admin section that
gets displayed in case the conf.d directory holds php-files. It should
indicate that there are files present that override settings visible
in the admin view.
MFH: Allow conf.d style directory configuration overriding (Bug #8172)
http://cvs.horde.org/diff.php/framework/Horde/Attic/Horde.php?rt=horde&r1=1.489.2.116&r2=1.489.2.117&ty=u
Allow conf.d style directory configuration overriding (Bug #8172)
http://git.horde.org/diff.php/framework/Core/lib/Horde.php?rt=horde-git&r1=2c85abba6e6b4677ffd5c43a0ddb62936f374f9d&r2=9774304b900cf35a6091e7be1761e5c07efa70bb
patch:
http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/kolab-webclient/horde/patches/horde-3.3.6/t_horde_HK__MP_ConfdStyleConfigurationOverride.diff
I still need to test it before I commit.
patch:
http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/kolab-webclient/horde/patches/horde-3.3.6/t_horde_HK__MP_ConfdStyleConfigurationOverride.diff
I still need to test it before I commit.
State ⇒ Assigned
Assigned to Gunnar Wrobel
- $output shouldn't be concatenated, it should be checked once for
each loaded file individually.
- I don't think it makes sense to apply the same for the vhost
configuration files. It should be sufficient to still have a single
vhost file, those are not being used by distributions anyway.
New Attachment: framework-fw3.diff
New Attachment: framework-trunk.diff
Attached a patch for trunk
are loaded, not *inside* the configuration files.
Also, please create a single patch.
- framework (3 and 4)
- horde (3 and 4)
- imp (4 and 5)
If they are ok, can you commit them, I will then prepare patches for
the other apps
If so, I will provide patches for apps (fw3, fw4, horde3, horde4,
imp4, imp5, ...)
/**
* Load conf.d style directory configuration
*
* @param string $path Path to the directory
* or to the parent file (must match *.php)
*/
function includeConfD($path) {
#mangle the path if needed (*.php -> *.d)
$path = preg_replace('/\.php$/', '.d', $path);
if (file_exists($path) && is_dir($path)) {
$files = glob("$path/*.php");
if ($files) {
foreach ($files as $conf) {
include_once $conf;
}
}
}
}
=========================
It can be used with "Horde_Config::includeConfD(__FILE__);" in, for
example, config/hooks.php
package. Modifying a file from another package is forbidden (against
policy).
I'm currently creating a debian package for kolab-webclient, that
depends on several horde apps (imp, kronolith, turba, ...) and change
the configuration. As I am not allowed to patch files from other
packages, I wanted to override settings with mine (to have a plug and
play behavior).
State ⇒ Feedback
Version ⇒ Git master
Priority ⇒ 1. Low
State ⇒ New
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Type ⇒ Enhancement
Summary ⇒ Allow conf.d style directory configuration overriding
Every bla.php config file (config/*.php of app/config/*.php) when
loaded, would then load all *.php files in the bla.d/ directory
alphabetically (convention would be to name them
01_toto.php...99_toto.php).
I'm affecting this to horde3 but this also applies to horde git.
Example of php config files :
config/conf.php
config/hooks.php
config/mime_drivers.php
config/motd.php
config/nls.php
config/prefs.php
config/registry.php (done)
imp/config/conf.php
imp/config/header.php
imp/config/hooks.php
imp/config/menu.php
...
turba/config/conf.php
...(other apps)