On Mon, 22 Dec 2003 15:26:53 -0800, Stas Bekman <[EMAIL PROTECTED]> wrote:
You don't need to walk the config tree to accomplish that. There is a much simpler way:
sub post_config { my($conf_pool, $log_pool, $temp_pool, $s) = @_;
for (my $vhost_s = $s->next; $vhost_s; $vhost_s = $vhost_s->next) { my $port = $vhost_s->port; my $val = $vhost_s->dir_config->{PostConfig}; warn "port: $port, val $val\n"; } ...
That is indeed much simpler. Is the fact that you can get from the root server to vhost to vhost documented anywhere? I couldn't find it in the docs.
I think not. Patches are welcome. This is really the next() method that belongs to the Apache::Server manpage.
But at least now there is a test that exercises PostConfig/OpenLogs and the above loop.
But unfortunately I don't think it will work in the general case for Apache::PageKit, because it needs to support different values in different locations, i.e. for this configuration:
PerlSetVar PKIT_SERVER xyz <VirtualHost one> <Location /a> PerlSetVar PKIT_ROOT /pk/a </Location> <Location /b> PerlSetVar PKIT_ROOT /pk/b </Location> </VirtualHost> <VirtualHost two> PerlSetVar PKIT_ROOT /pk/c PerlSetVar PKIT_SERVER pqr </VirtualHost>
I should make three calls: Apache::PageKit->startup("/pk/a", "xyz"); Apache::PageKit->startup("/pk/b", "xyz"); Apache::PageKit->startup("/pk/c", "pqr");
Of course vhost won't give you the info about non-top-level PerlSetVars. But since with <Perl> sections you can autogenerate the above config, it should be easy to make all three calls as you generate them.
__________________________________________________________________ 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
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html