httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Module initialization and per-directory config directives
Date Fri, 14 May 1999 21:05:14 GMT

In article <Pine.LNX.3.95.990501232100.23850I-100000@bourbon.netvision.net.il> you wrote:

> One of the problems the PHP 3.0 Apache module had, was that httpd.conf
> directives were being parsed before module startups.  Since PHP uses
> various data structures to store values it reads from Apache directives
> (among other sources), and since these data structures weren't being
> initialized before Apache was calling the PHP's callback functions, we had
> to change the callbacks so that they always call PHP's startup function
> before going on.  Of course, we've put a flag inside that function so that
> it won't actually initialize more than once, but still, each .conf or
> .htaccess directive parsing resulted in an additional function call, and
> that function call had to be written on the top of every handler. 
> 
> While cleaning mod_php3.c for PHP 4.0, I was wondering on whether this
> behavior can be changed, or fixed in some way.  Is there no way to ensure
> that the module's startup is run before its callbacks are called with
> directive information? 
> 
> I realize that there's a good chance you can't simply move the module
> startups to be called before the configuration parsing (for various
> reasons), but if you can, or alternately, can provide an additional module
> initialzation function that's guarenteed to be called before the
> configuration parsing, it would make callbacks look cleaner and be more
> efficient...

BTW, with EAPI you could use the add_module() hook for this.  It's the
definitive first time you can do anything: directly after the module was added
to list of linked modules. I usually use this to register hooks.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message