perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: removing PerlLoadModule directive handler requirement
Date Tue, 20 May 2003 23:50:28 GMT
Geoffrey Young wrote:
> hi all...
> 
>   I'd like to suggest that we remove the requirement that modules loaded 
> with PerlLoadModule need to have directive handler support.
> 
>   now that PerlModule defers init processing until after the interpreter 
> has started, there is currently now way to force an early interpreter 
> invocation for actions that are required on startup.  for instance, in 
> addition to directive handler support, the new aaa ap_register_provider 
> hook needs to be called at startup before the authen modules see the 
> Auth*Provider statements in httpd.conf (otherwise the server won't 
> start).  so, if I want my Perl module to register a provider, I don't 
> have any way to get the call in early enough unless I provide some dummy 
> directive handlers (well, I can force some <Perl> sections in there to 
> trick the early interpreter, but :)
> 
>   anyway, I'm suggesting that PerlLoadModule be available to all 
> handlers that require an interpreter be created early, not merely 
> directive handlers.  the below patch is simple enough and does the 
> trick.  all tests pass for me.

You know, it seems that PerlLoadModule is a misleading name. It suggests that 
its purpose is to load a module. It'd be much better off called 
PerlDirectiveModule or something like that. Otherwise it fits your purpose ;)

Should we use a side-effect of an existing mechanism to do something else? May 
be we need to have a special directive that will start perl early? PerlStartNow?

> Index: src/modules/perl/modperl_module.c
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_module.c,v
> retrieving revision 1.13
> diff -u -r1.13 modperl_module.c
> --- src/modules/perl/modperl_module.c   12 May 2003 13:00:15 -0000      
> 1.13
> +++ src/modules/perl/modperl_module.c   20 May 2003 13:09:19 -0000
> @@ -636,8 +636,7 @@
>  #endif
> 
>      if (!(module_cmds = modperl_module_cmds_get(aTHX_ modp))) {
> -        return apr_pstrcat(p, "module ", modp->name,
> -                           " does not define @APACHE_MODULE_COMMANDS", 
> NULL);
> +        return NULL;
>      }
> 
>      fill = AvFILL(module_cmds);
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message