6.0.0-git
2019-06-20

[#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 2009-04-09 (3724 days ago)
Due
Updated 2010-03-07 (3392 days ago)
Assigned 2010-01-12 (3446 days ago)
Resolved
Milestone
Patch No

History
2010-03-04 12:06:53 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.
2010-03-04 11:57:54 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.
2010-03-04 11:51:17 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
2010-03-04 11:38:53 CVS Commit Comment #13 Reply to this comment
2010-01-12 10:58:03 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!
2010-01-12 10:09:37 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.
2010-01-12 09:31:51 Jan Schneider Comment #10
Assigned to Gunnar Wrobel
State ⇒ Assigned
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.
2010-01-12 09:29:26 Jan Schneider Deleted Original Message
 
2010-01-12 09:29:05 Jan Schneider Deleted Original Message
 
2010-01-12 09:29:00 Jan Schneider Deleted Original Message
 
2010-01-12 09:28:54 Jan Schneider Deleted Original Message
 
2010-01-12 09:28:45 Jan Schneider Deleted Original Message
 
2010-01-12 09:28:36 Jan Schneider Deleted Original Message
 
2009-06-17 15:49:10 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
2009-06-17 15:48:19 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
2009-05-14 16:53:38 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.
2009-05-09 09:44:21 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
2009-05-09 09:43:07 math (dot) parent (at) gmail (dot) com New Attachment: imp-git.diff
 
2009-05-09 09:42:49 math (dot) parent (at) gmail (dot) com New Attachment: imp-FRAMEWORK_3.diff
 
2009-05-09 09:42:27 math (dot) parent (at) gmail (dot) com New Attachment: horde-TRUNK.diff
 
2009-05-09 09:42:00 math (dot) parent (at) gmail (dot) com New Attachment: horde-FRAMEWORK_3.diff
 
2009-05-09 09:41:39 math (dot) parent (at) gmail (dot) com New Attachment: framework-TRUNK.diff
 
2009-05-09 09:41:20 math (dot) parent (at) gmail (dot) com New Attachment: framework-FRAMEWORK_3.diff
 
2009-05-07 17:05:49 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, ...)
2009-04-26 12:11:37 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


2009-04-25 09:32:22 Jan Schneider State ⇒ Accepted
 
2009-04-23 21:02:26 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).
2009-04-16 21:46:37 Jan Schneider Comment #2
State ⇒ Feedback
Version ⇒ Git master
Reply to this comment
Why?
2009-04-09 02:00:28 math (dot) parent (at) gmail (dot) com Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Allow conf.d style directory configuration overriding
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
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