Re: Conf files

"B. Kamer" <[email protected]> Wed, 25 May 2005 01:50:56 +0200
Newsgroups gmane.comp.lib.binarycloud.devel
Message-ID <[email protected]>
On May 24, 2005, at 23:17, Jean-Christophe Michel wrote:

> B. Kamer wrote:
>
>> I am wondering if we should cleanup the conf a little more...
>>
>
> Why not...
>
>
>> Currently conf files in the core/vortex packages must have the same
>> name as the package. This is works but is a bit restrictive. Also   
>> they
>> must not be in a directory 'conf' but in the package root.
>>
>
> I don't think the name similarity is enforced in any way. It's only a
> recommandation. Being is a dir conf/ is not really necesary imho since
> the name ends with .conf.xml.

well, from Conf::_loadConfiguration()

         $dir = dir(BC_PATH_INCLUDE . '/binarycloud/');
         while ($entry = $dir->read()) {
             $filename = BC_PATH_INCLUDE . '/binarycloud/' . $entry .  
'/' . $entry . '.conf.xml';

and

         $dir = dir(BC_PATH_INCLUDE . '/vortex/');
         while ($entry = $dir->read()) {
             $filename = BC_PATH_INCLUDE . '/vortex/' . $entry .  
'/' . $entry . '.conf.xml';

this means [package name] / [package name] .conf.xml. only 1  
configuration per package can be loaded.

>
>
>> some problems/oddities:
>> init/binarycloud.conf.xml is now included hardcoded by Conf
>>
>
> What's the pb with that ?

its minor...

>
>
>> all vortex packages keep there conf files in a separate directory and
>> are thus never cached...
>>
>
> If it's true it's a real problem. Please explain more.

most vortex modules keep there factory conf files in a vortex/ 
[package]/conf/[package].conf.xml. The above code never reads there.

>
>
>> I would like to change this logic to:
>>
>> FACTORY configuration files are in one of these;
>> {{{
>>    binarycloud/*/conf/*.conf.xml
>>    vortex/*/conf/*.conf.xml
>> }}}
>>
>> No change would be done to the workspace files.
>>
>
> I don't see the advantage :/

If we decide to have a separate directory 'conf' per package [1] and  
read all files in that directory [2] i think we would benefit in  
these ways.

[1] The conf files would be nicely seperated from other files and  
directories which seems cleared. Most part of an package have there  
own directory, why not configuration files too?

[2] It would illiminate the minor point from above. The hardcoded  
path to the binarycloud.conf.xml wouldn't be necessary anymore since  
all file ending on .conf.xml (and are possibly in /conf/) are cached.

We do have to make a liitle effort anyway since the factory vortex  
configuration files are not read. Either moving them to their package  
root or change the code to use the 'conf' directory. Why then do we  
in binarycloud/* use a conf directory and in vortex not?

So, I believe it would make Conf in its application logic and the  
binarycloud file distribution a little more consistent and therefore  
easier to understand and maintain.

Or we can do all conf.xml files in all directories ;-)

> -- 
> Jean-Christophe Michel
> _______________________________________________
> dev mailing list
> dev-PnctHDZWAvB/Cz2I37pSEPZ4XP/[email protected]
> http://lists.binarycloud.com/mailman/listinfo/dev
>
>

_______________________________________________
dev mailing list
dev-PnctHDZWAvB/Cz2I37pSEPZ4XP/[email protected]
http://lists.binarycloud.com/mailman/listinfo/dev