Ask Bjørn Hansen wrote: > > On May 1, 2006, at 6:10 PM, David Sparks wrote: > >> I'm wondering why when I hook_config() in a plugin that hook is called >> whenever qpsmtpd calls ->config() somewhere? my hook_config() gets >> called for requests for 'me' and 'smtpgreeting'. Is there no way to >> have this hook only called from the plugin that defined it? It just >> seems unclean to start off a hook_config with a test to see if you can >> answer the request. > > > If you only need it for configuration in that plugin, just use a > regular method rather than the plugin system.
Is there a preferred way to get the config dir? To call config_dir() I seem to need to "use Qpsmtpd;" in my plugin and call it via Qpsmtpd::configdir(). I would just leave the hook_config and ignore the extra calls to it if it worked when you accessed the config from hook_init(). However I can see that the hook_config isn't setup until after hook_init() finishes. > The hook_config was intended as a general configuration replacement. > (The example config plugin gets the configuration from an http server). Gotcha. Thanks, ds
