gunnar: server/pear/Horde_Framework/patches/Horde_Framework-0.0.2dev20091215 t_horde_HK__MP_ConfdStyleConfigurationOverride.diff, NONE, 1.1

cvs at kolab.org cvs at kolab.org
Tue Jan 12 14:59:58 CET 2010


Author: gunnar

Update of /kolabrepository/server/pear/Horde_Framework/patches/Horde_Framework-0.0.2dev20091215
In directory doto:/tmp/cvs-serv16266/pear/Horde_Framework/patches/Horde_Framework-0.0.2dev20091215

Added Files:
	t_horde_HK__MP_ConfdStyleConfigurationOverride.diff 
Log Message:
Doh, this is a framework patch. Not a patch for the base application.

--- NEW FILE: t_horde_HK__MP_ConfdStyleConfigurationOverride.diff ---
From: math.parent at gmail.com
Subject: [PATCH] t/horde/HK_MP/ConfdStyleConfigurationOverride

Allow conf.d style directory configuration overriding of the horde
configuration.

STATUS: ACCEPTED
HORDE_REF: http://bugs.horde.org/ticket/8172

Signed-off-by: Gunnar Wrobel <p at rdus.de>

---
 framework/Horde/Horde.php |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/framework/Horde/Horde.php b/framework/Horde/Horde.php
index a0692ad..ae6dc71 100644
--- a/framework/Horde/Horde.php
+++ b/framework/Horde/Horde.php
@@ -542,6 +542,29 @@ HTML;
             $was_included = true;
         }
 
+        // Load global configuration stanzas in .d directory
+        $directory = preg_replace('/\.php$/', '.d', $config_dir . $config_file);
+        if (file_exists($directory) && is_dir($directory)) {
+            $sub_files = glob("$directory/*.php");
+            if ($sub_files) {
+                foreach ($sub_files as $sub_file) {
+                    ob_start();
+                    $success = (is_null($var_names) && !$show_output)
+                        ? include_once $sub_file
+                        : include $sub_file;
+                    $output = ob_get_clean();
+
+                    if (!empty($output) && !$show_output) {
+                        return PEAR::raiseError(sprintf('Failed to import configuration file "%s": ', $sub_file) . strip_tags($output));
+                    }
+
+                    if (!$success) {
+                        return PEAR::raiseError(sprintf('Failed to import configuration file "%s".', $sub_file));
+                    }
+                }
+            }
+        }
+
         // Load vhost configuration file.
         if (!empty($conf['vhosts']) || !empty($GLOBALS['conf']['vhosts'])) {
             $server_name = isset($GLOBALS['conf']) ? $GLOBALS['conf']['server']['name'] : $conf['server']['name'];
-- 
tg: (b673385..) t/horde/HK_MP/ConfdStyleConfigurationOverride (depends on: master)
-- 
TOPGIT patch commit log
=======================

commit c72bf75efb524b4bc2ae6002a73cf09cca0f4b45
Author: Gunnar Wrobel <p at rdus.de>
Date:   Tue Jan 12 10:57:13 2010 +0100

    Modified according to Jans comments in http://bugs.horde.org/ticket/8172

commit 1cf3049c77b71f41b22fbd8e98d702ec7078060b
Author: Gunnar Wrobel <p at rdus.de>
Date:   Tue Jan 12 10:55:53 2010 +0100

    Modified according to Jans comments in http://bugs.horde.org/ticket/8172

commit 3e563ed0e07e728c3f51b7d719f9b57c1c75e520
Author: Gunnar Wrobel <p at rdus.de>
Date:   Tue Jan 12 10:25:14 2010 +0100

    Pulled patch from http://bugs.horde.org/ticket/8172





More information about the commits mailing list