Mark Stosberg <[EMAIL PROTECTED]> wrote:
> On 2005-09-30, Michael Graham <[EMAIL PROTECTED]> wrote:
> > I don't know about the other CGI::Application plugins, but
> > C::A::P::Config::Context does this for you already. It provides a class
> > method for getting at configuration data:
> >
> > my $config =
> > CGI::Application::Plugin::Config::Context->get_current_context;
>
> Is there a caveat needed here about unexpected results under mod_perl ?
Actually, it should be fine. I use it under PersistentPerl without
problems (at least so far).
There's only one web request per process, so the "current config" for
each process is always whatever you set up at the start of this request.
In your cgiapp_init(), you call:
$self->conf->init('file' => 'app.conf');
If it happens that there was already a "current config" lingering around
from the last request served by the process, calling $self->conf->init
overwrites it with the new current config.
(Mind you, I haven't thought through how this sytem works under
threading - e.g. on mod_perl on Windows, using the threaded MPM).
> This is a neat idea, and one I may emulate in ::Plugin::ConfigAuto;
Cool!
Michael
---
Michael Graham <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]