6.0.0-alpha10
5/14/25

[#8172] Allow conf.d style directory configuration overriding
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

History
03/04/2010 12:06:53 PM Jan Schneider Comment #16 Reply to this comment
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.
Agreed.
03/04/2010 11:57:54 AM Gunnar Wrobel Comment #15 Reply to this comment
There is one thing that might still need to be corrected for this patch:

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.
03/04/2010 11:51:17 AM CVS Commit Comment #14 Reply to this comment
Changes have been made in CVS for this ticket:

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
03/04/2010 11:38:53 AM CVS Commit Comment #13 Reply to this comment
01/12/2010 10:58:03 AM math (dot) parent (at) gmail (dot) com Comment #12 Reply to this comment
Just a note to Mathieu that I'm on it... This would be the updated 
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.
Thanks. This is great!
01/12/2010 10:09:37 AM Gunnar Wrobel Comment #11 Reply to this comment
Just a note to Mathieu that I'm on it... This would be the updated 
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.
01/12/2010 09:31:51 AM Jan Schneider Comment #10
State ⇒ Assigned
Assigned to Gunnar Wrobel
Reply to this comment
A few comments, otherwise looks fine:
- $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.
01/12/2010 09:29:26 AM Jan Schneider Deleted Original Message
 
01/12/2010 09:29:05 AM Jan Schneider Deleted Original Message
 
01/12/2010 09:29:00 AM Jan Schneider Deleted Original Message
 
01/12/2010 09:28:54 AM Jan Schneider Deleted Original Message
 
01/12/2010 09:28:45 AM Jan Schneider Deleted Original Message
 
01/12/2010 09:28:36 AM Jan Schneider Deleted Original Message
 
06/17/2009 03:49:10 PM math (dot) parent (at) gmail (dot) com Comment #9
New Attachment: framework-fw3.diff Download
Reply to this comment
attached is a patch for fw3
06/17/2009 03:48:19 PM math (dot) parent (at) gmail (dot) com Comment #8
New Attachment: framework-trunk.diff Download
Reply to this comment
OK, I have found the proper function for this: Horde::loadConfiguration.



Attached a patch for trunk
05/14/2009 04:53:38 PM Jan Schneider Comment #7 Reply to this comment
No, the conf.d loading has to be done where the configuration files 
are loaded, not *inside* the configuration files.

Also, please create a single patch.
05/09/2009 09:44:21 AM math (dot) parent (at) gmail (dot) com Comment #6 Reply to this comment
I've submitted patches for

- 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
05/09/2009 09:43:07 AM math (dot) parent (at) gmail (dot) com New Attachment: imp-git.diff
 
05/09/2009 09:42:49 AM math (dot) parent (at) gmail (dot) com New Attachment: imp-FRAMEWORK_3.diff
 
05/09/2009 09:42:27 AM math (dot) parent (at) gmail (dot) com New Attachment: horde-TRUNK.diff
 
05/09/2009 09:42:00 AM math (dot) parent (at) gmail (dot) com New Attachment: horde-FRAMEWORK_3.diff
 
05/09/2009 09:41:39 AM math (dot) parent (at) gmail (dot) com New Attachment: framework-TRUNK.diff
 
05/09/2009 09:41:20 AM math (dot) parent (at) gmail (dot) com New Attachment: framework-FRAMEWORK_3.diff
 
05/07/2009 05:05:49 PM math (dot) parent (at) gmail (dot) com Comment #5 Reply to this comment
Is this the good way to go?



If so, I will provide patches for apps (fw3, fw4, horde3, horde4, 
imp4, imp5, ...)
04/26/2009 12:11:37 PM math (dot) parent (at) gmail (dot) com Comment #4 Reply to this comment
Here is the relevant part for horde3 (probably in Horde/Config.php):



     /**

      * 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


04/25/2009 09:32:22 AM Jan Schneider State ⇒ Accepted
 
04/23/2009 09:02:26 PM math (dot) parent (at) gmail (dot) com Comment #3 Reply to this comment
On Debian systems configuration files could only be owned by one 
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).
04/16/2009 09:46:37 PM Jan Schneider Comment #2
State ⇒ Feedback
Version ⇒ Git master
Reply to this comment
Why?
04/09/2009 02:00:28 AM math (dot) parent (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
State ⇒ New
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Type ⇒ Enhancement
Summary ⇒ Allow conf.d style directory configuration overriding
Reply to this comment
(Inspired by apache's conf.d directory, and also horde's registry.d)



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)


Saved Queries