Erik Norgaard wrote:
Philip M. Gollucci wrote:Erik Norgaard wrote:Hi:I have successfully created a module that declares some configuration parameters which should be available to the handler: dbDriver, dbHost, dbName, dbUser and dbPassword. Or so I think, I followed this guide:http://perl.apache.org/docs/2.0/user/config/custom.htmlThis section of it doesn't answer that for you ?http://perl.apache.org/docs/2.0/user/config/custom.html#toc_Directive_Callback_SubroutineThe simple answer is try it :)The yet simpler ? :) Well, what confuses me is the merging example in the end of the text. Anyway, the text you refer to tells how I can get global/serverwide parameters, but I don't see any mention of whether or not parameters defined for a different virtual host is possible. I prefer not for security.
I believe you can get to anything:
If a request is made to a resource inside a virtual host, $srv_cfg will contain the object of the virtual host's server.
my $srv_cfg = Apache2::Module::get_config('MyApache2::MyParameters', $s);
To reach the main server's configuration object use:
use Apache2::Module ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
...
if ($s->is_virtual) {
my $base_srv_cfg = Apache2::Module::get_config('MyApache2::MyParameters',
Apache2::ServerUtil->server);
print $base_srv_cfg->{name};
}
However, I think you can still get to anything you want:
my $tree = Apache2::Directive::conftree();
by traversing this far enough down. (see t/response/TestApache/conftree.pm)
--
------------------------------------------------------------------------
Philip M. Gollucci (suppressed) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F
When I call your name, Girl, it starts to flame
Burning in my heart, Tearing it all apart..
No matter how I try My love I cannot hide....
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.