Stas Bekman wrote:
> Geoff wanted PerlLoadModule be available to all modules that require
> an interpreter be created early, not merely directive handlers.
> 
> So as discussed in several threads the conclusion was:
> 
> - remove the magickness of PerlLoadModule wrt directives
> - add a special Apache::Module API which will add directives, like so:
> 
> package MyApache::MyDirectives;
> my @cmds = (...);
> Apache::Module::add(__PACKAGE__, [EMAIL PROTECTED]);
> 
> since this issue is marked as mp2-release show-stopper, Philippe hs
> volunteered to resolve it. Is that OK Geoff? (you are the owner of this
> item in todo/release). 

sure.  philippe can knock himself out :)

> Also do you already have some code available?

no, I never got to implementing it.

> Especially tests, since you wanted it because you wanted to ensure that
> the module is loaded early, but I have not seen any test cases.

Apache-AuthenHook on CPAN is a good example.  at the end of AuthenHook.xs I
have this code:

    ap_register_provider(modperl_global_get_pconf(),
                         AUTHN_PROVIDER_GROUP,
                         SvPV_nolen(newSVsv(provider)), "0",
                         &authn_AAH_provider);

which needs to be called _before_ mod_auth_basic or mod_auth_digest go
looking for a provider specified in httpd.conf.  if AuthenHook were not
implemented via directive handlers there would be no way to do this outside
of inserting <Perl> sections in httpd.conf or somesuch.

> 
> While we are at it, we may consider renaming this directive, since it's
> now getting even further away from Load thing. PerlModuleNow?
> PerlModuleEarly?

I think the name is exactly right.  from an apache perspective, LoadModule
runs a module's init routines when LoadModule is called, without later
deferring the init until some later time.  PerlLoadModule would do exactly
the same - load a perl module and run it's init code _now_.  using
PerlLoadModule is analgous to all the other Perl* directives we have
(PerlSetVar, PerlPassEnv, etc) that are pretty much behave exactly the same
as Apache directives but are tweaked for Perl purposes.

as I've brought up before, I think the entire notion of "starting early" is
bogus - it's not "early" if I require perl code to run while httpd.conf is
being parsed, it is exactly the right time.

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to