On Tue, Jan 24, 2006 at 09:08:08AM -0500, Jason Kohles wrote:
> On 1/24/06, Gavin Carr <[EMAIL PROTECTED]> wrote:
> >
> > If your plugin can be configured, place the configuration in class
> > variables - for example,
> >
> > $MasonX::Plugin::Timer::Units = 'seconds';
> >
> > These can be set either from httpd.conf via PerlSetVar directives,
> > or in perl directly from a handler.pl file.
> >
> > but I can't seem to figure out the magic to get the PerlSetVar variable
> > name picked up properly. Can someone point me in the right direction - if
> > I want to set a class variable $XYZ::Plugin::Foo, what would the
> > PerlSetVar incantation look like?
> >
> I think the implication is supposed to be that it is your choice if
> you want your plugins to be configured using class variables or
> PerlSetVar. There is no magic (that I've seen anyway, and such a
> thing would be deep magic indeed) that will automatically figure out
> which variables to set in your modules by looking at your PerlSetVar
> commands.
Ah. Things like MasonX::Request::WithApacheSession do provide such
deep magic (for Mason*) PerlSetVars, and I was indeed looking for
something like that.
> That being said, if you want to give people the option to
> do either one, the easiest way is probably:
>
> my $foo = $r->dir_config('XYZPluginFoo') || $XYZ::Plugin::Foo ||
> 'sensible_default';
Cool - doing it the non-magic way is fine.
Thanks much,
Gavin
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users