On 2013-04-15 23:12, Tim Traver wrote:
Hi all,

is there a way to access the module config tables of another module?

For instance, if I want to see (from my module) what the path to the SSL
cert is in the ssl_module, how can I go about doing that?

And are there any tutorials on how to retrieve and set config values?

Thanks,

Tim

I think you have two options:

1) You handle exactly the same configuration directive in your module in order to "intercept" what other modules see. This is possible because apache invokes the configuration handling callbacks of all modules that have registered for that directive. So in theory your module can intercept the whole configuration of apache and all its modules.

2) You read the configuration object of the other module. However you'll need two pieces of information in order to do so: The name of the other's module object and the structure of its configuration object.

For example you'd do:

OtherModConf *conf = (OtherModConf *)ap_get_module_config(conf_vector, &other_mod_obj);
use(conf->conf_value_of_interest);

I think you cannot know other_mod_obj unless you search in the other module's sources. (You could check the exported symbols of the binary as well.)

And you may know OtherModConf only if the other module publishes its structure in a header file intended to be included in modules such as yours.


Sorin

Reply via email to