This patch returns the functionality we had in mp1:
use Apache::ServerUtil (); my $cnt = Apache->server->start_cnt(); open my $fh, ">>/tmp/out" or die "$!"; print $fh "cnt: $cnt\n"; close $fh;
So I threw that into a module, which I PerlLoadModule, and I see the following behavior:
httpd -k start cnt: 1 cnt: 2
httpd -k graceful cnt: 1 cnt: 3
httpd -k graceful cnt: 1 cnt: 4
httpd -k stop cnt: 1
So one can always tell that when cnt == 1, that means that the config is parsed for the first time, when the count is 2 or higher that means that's the restart. Numbers 3 and higher mean that it's a graceful restart, after internal restart.
Are we happy with that behavior?
Now to the API: since Apache->server is global anyway, this:
Apache->server->start_cnt();
can be made into just an function:
Apache::ServerUtil::start_cnt();
but I'm not sure what's the best function name (take a look at the counts above). really what it means is how many times httpd.conf was parsed (or still being parsed on the nth time). with the special case for those '1' values.
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
