On 2004-09-25 16:51:33 +0200, Michael Holzt wrote: > > I don't quite see why a config hook plugin should have to know from > > which plugin or hook it is called. > > See my posting yesterday. With every new plugin we are running into the > danger of having collisions within config names. This could be solved > by either prepending 'pluginname_' to each config name, or as i would > prefer by giving both informations seperated to the conf plugin. This > would also allow my suggestion of having ~qpsmtpd/config/plugin/conffile. > > > So you can do something like: > > > > $self->qp->config("my_plugin/category1/parameter2", > > { > > plugin => ref($self), > > hook => "rcpt", > > rcpt => $rcpt, > > foo => [ qw(baz gazonk) ], > > } > > ); > > I don't see why i should have to add plugin and hook if the > $self->qp->config subroutine could do this for me. I think your solution > is more complicated.
On purpose. I think that depending on plugin and hook is horrible, and if you really want to do that, you should have to write it explicitly. Namespaces are fine. If every plugin starts, by convention, all its configuration parameters with "${pluginname}/" (or "${pluginname}::" or "${pluginname}_") I'm all for it. But these names should be global: If two plugins ask for the same parameter, they should get the same value. (Strictly speaking even $arg is unnecessary - whatever can be passed there could also be encoded into the $config parameter). If the plugin name is passed implicitly, it isn't possible for two plugins to access the same configuration. > I'm just looking for a generic and powerful solution for the whole > problem of configuration. This could after all mean that some old > plugins might need to be modified (your solution above will in > fact need modification in many plugins!). "My solution" is the status quo. So by definition it doesn't require any modification. It would be desirable to modify a lot of plugins to take advantage of it, though. hp -- _ | Peter J. Holzer | Je höher der Norden, desto weniger wird |_|_) | Sysadmin WSR | überhaupt gesprochen, also auch kein Dialekt. | | | [EMAIL PROTECTED] | Hallig Gröde ist fast gänzlich dialektfrei. __/ | http://www.hjp.at/ | -- Hannes Petersen in desd
pgplJtlNRkZwf.pgp
Description: PGP signature