Menu

#96 compiler.ini - make tag paths mergeable

open
nobody
None
5
2005-02-19
2005-02-19
No

I've started using the 'merging' .ini file config
handler lately. It works wonderfully for everything
except one thing: in my compiler.ini I have to list
all the WACT built-in tag paths in my [tags] section
plus the paths containing my custom
tags/filters/properties. I would prefer to only list
my custom paths in the config file (and have the WACT
ones automatically merged in).

The merging config handler doesn't work as I'd like
because the whole list of paths is stored as a single
config value:

[tags]
path =
"%WACT_TAG_ROOT%core;%WACT_TAG_ROOT%data;%WACT_TAG_ROOT%form;%WACT_TAG_ROOT%list;%WACT_TAG_ROOT%page;%WACT_TAG_ROOT%calendar;%WACT_TAG_ROOT%encode;%WACT_TAG_ROOT%html;%WACT_TAG_ROOT%front"

That means if I have a 'tags.path' entry in my config
file, it overwrites the one in the main WACT compiler.ini.

What about the following minor change? You could
instead list each path separately in the config file
(like the classes in autoload.ini):

[paths]
core='%WACT_TAG_ROOT%core'
data='%WACT_TAG_ROOT%data'
form='%WACT_TAG_ROOT%form'
...

Also the name [paths] is a more general description of
the directories being pointed to. Currently they
contain not only tags, but also filters and properties.

The same comment could be made about any config values
that store a list of elements. e.g.
compiler.ini/parser.saxfilters

What do you think?

Discussion

  • Pavel Shevaev

    Pavel Shevaev - 2005-02-19

    Logged In: YES
    user_id=960690

    And how about this one:

    [tags]
    paths[]='%WACT_TAG_ROOT%core'
    paths[]='%WACT_TAG_ROOT%data'
    paths[]='%WACT_TAG_ROOT%form'

    IMHO it's more readable and flexible yet requires some ini
    parsing tricks...

     
  • Michael van Dam

    Michael van Dam - 2005-02-20

    Logged In: YES
    user_id=604745

    That could work too... I didn't really like the idea of
    having to come up with a 'key' for each path.

    I wonder if a better solution would be just to make the
    template engine look for paths recursively. Then only one
    path is needed for all of the built-in WACT tags (i.e.
    '%WACT_TAG_ROOT%'). This would really reduce the need for
    merging. But I guess the point of being able to specify
    each path is to allow for compilation speedup by excluding
    unused tags.

     

Log in to post a comment.

MongoDB Logo MongoDB