FAQ
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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodperl @
categoriesmodperl, perl
postedApr 17, '08 at 3:50p
activeApr 17, '08 at 3:50p
posts1
users1
websiteperl.apache.org

1 user in discussion

Zsolt Kecskemeti: 1 post

People

Translate

site design / logo © 2021 Grokbase