[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Calling CGI::Application::Plugin::ConfigAuto from cgiapp_init


On Mon, 13 Dec 2004 14:45:10 -0500, Sergej Zoubok <suppressed> wrote:
> >It might be worthwhile for the CAP::AutoConfig module to look at the
> >PARAMS that are defined when you create the object:
> >
> >my $app = WebApp->new( PARAMS => { cfg_file => 'config.pl' });
> >$app->run();
> >
> >This would require an addition to CAP::AutoConfig, but it would be
> >minor.  All CAP::AutoConfig would need to do is if $self->cfg_file was
> >not called, then look in $self->param('cfg_file') for a potential
> >config file.
> 
> Cees,
> 
> Do you mean you would provide the name of the config file twice to
> provide a fall back for calls from cgi_init? As in:

No, having to provide it twice would be a step backwards in my opinion.

> # In my instance script
> my $app = WebApp->new(PARAMS => { cfg_file => 'config.pl' });
# the call to cfg_file should not be needed here!
# $app->cfg_file('config.pl');
> $app->run();
> 
> OR that the plugin would call cfg_file from within the application
> module's cgi_init using the parameter passed via new?  Or something
> else entirely? :-)

I would suspect that the 'cfg' method could be changed to look at
$self->param('cfg_file') if the user hasn't already called cfg_file (I
haven't looked at the code for the plugin so I don't know for sure).

So you can set things up normally using $self->cfg_file('config.pl'),
OR you could configure it when you create your application object
using

my $app = WebApp->new(PARAMS => { cfg_file => 'config.pl' });

But like I said, the plugin author would have to add this
functionality to CAP::ConfigAuto for this to work.

Cheers,

-- 
Cees Hek

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.