Thomas Koch wrote:
> 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 );

I thought there is already an issue (enhancement) for this: 
http://issues.ez.no/10979. Is it similar?


-- 
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to