Hello Apache-people,
I'm in the process of porting to apache 2 a module I developped for
apache 1.3. The 'mod_macro' module add macro definition capabilities
to apache configuration files. Macros are expanded on the fly and parsed.
With apache 1.3, I needed an initialization phase each time a new
configuration cycle is started, as there are two analyses of the
configuration file each time apache is launched. The hack I found was to
notice that the temporary pool has changed to re-initialized my internal
data structures which holds the description of macros... quite poor.
Now with apache 2, I digged out in the source code a 'pre_config' and
'post_config' hook that look just fine, so I was planing to use that
instead of the previous hack. However :
1/ the apache configuration is still read twice.
well, why not if it pleases you.
2/ the pre_config hook is run *AFTER* the configuration file
is read. Indeed, you can see that in main.c where
ap_run_pre_config() is called after ap_read_config()
Thus here are my questions:
1/ as 'PRE' is a latin prefix which means before, would it be possible for
the sanity of the developpers to either:
a/ call it *before* the configuration is read.
b/ or rename it 'post_config';-)
then the 'post_config' can be renamed 'post_post_config';-)
2/ if the pre_config is to be run anyway after the configuration file is
read, could you suggest another hook I could use ? I can't see any...
and the developper documentation is rather scarse and not up to date.
3/ or explain what I missed in the source code to understand the logic
behind all that.
Thanks in advance for your help!
--
Fabien.