[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: WELCOME to suppressed
- Subject: Re: WELCOME to suppressed
- Date: Thu, 17 Apr 2008 16:49:38 +0100
- From: "Zsolt Kecskemeti" <suppressed>
Hi,
At http://perl.apache.org/docs/2.0/user/config/custom.html#C_SERVER_CREATE_
it should be noted about this function (and also about DIR_CREATE) that
it will be called if there is at least one custom directive
present in httpd.conf.
So setting so called 'system defaults' is not possible this way
because if you do not have at least one directive in your httpd.conf,
then the server configuration object will not get initialised.
For example if I have this in MyParams.pm:
sub SERVER_CREATE {
my ($class, $parms) = @_;
return bless {
'name' => __PACKAGE__,
'MyParam1' => '2',
'MyParam2' => '4',
}, $class;
}
and in my httpd.conf I want to get server defaults by commenting out some MyParam values like
PerlLoadModule MyParams
#MyParam1 1
#MyParam2 0
then if in my code I try to access the server configuration object like this
my $srv_cfg = Apache2::Module::get_config('MyParams', Apache2::ServerUtil->server);
I get undef.
Is this a bug or a feature? The documentation
suggests that it will be called all the time and event suggests to use
it to preset some values here if necessary.
Regards,
Zsolt Kecskemeti
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.