[Tickets #8172] Re: Allow conf.d style directory configuration overriding
bugs at horde.org
bugs at horde.org
Sun Apr 26 12:11:38 UTC 2009
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/8172
------------------------------------------------------------------------------
Ticket | 8172
Updated By | math.parent at gmail.com
Summary | Allow conf.d style directory configuration overriding
Queue | Horde Framework Packages
Version | Git master
Type | Enhancement
State | Accepted
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
math.parent at gmail.com (2009-04-26 08:11) wrote:
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
More information about the bugs
mailing list