Hi,

I'd like to ask, if it would make sense to have a configuration override 
system in ezc as it exists for eZPublish. A first draft of the usage is 
written below.

Thanks for comments,

Thomas Koch


// The directories, where settings files can reside. The override manager
// starts searching for a setting in the last given directory. That means the
// settings in the last directory always wins over the settings in the first
// directory.
$dirs = array( 'settings',
               'settings/override',
               'extension/ymcbla/settings',
               'settings/siteaccess/example'
            );

// Defines the readers that can be used for setting files.
$readers = array( 'ezcConfigurationIniReader',
                  'ezcConfigurationArrayReader');

// The manager hides the override mechanism and can be used as a manager for a
// simple settings directory.
$cfg = new ezcConfigurationOverrideManager( $dirs, $readers );

$cfg->getSetting( $name, $group, $setting );

// Then there should be a ConfigurationCacheTieIn
// The TieIn loads the ini files only, if there is nothing in the cache.
$cache = ezcCacheManager::getCache( 'ini-cache' );

$cfg = new ezcConfigurationCacheTieIn( $cfg, $cache );
$cfg->getSetting( $name, $group, $setting );

-- 
Thomas Koch, Software Developer

Young Media Concepts GmbH
Sonnenstr. 4
CH-8280 Kreuzlingen
Switzerland

Tel    +41 (0)71 / 560 53 81
Fax    +41 (0)71 / 560 53 89
Mobile +49 (0)170 / 753 89 16
Web    www.ymc.ch
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to