|
From: Jason R. <ja...@ar...> - 2000-12-19 00:35:19
|
That's my whole problem... $r is not set. I don't even understand
why I need a request object when all I want to do is to access the
database. I would be ecstatic if I could just get a hold of the
virtual username. Correct me if I am wrong, but I thought that the
request object would only be valid if there was a request. I have
this problem when I start the server, because there is no request. I
also had luck with this code:
my $virtuser = "slash";
my $driver = DBIx::Password->connect($virtuser);
my $sth = $driver->prepare("
SELECT name,location FROM table_map
");
$sth->execute();
while(my ($name,$location) = $sth->fetchrow_array()){
$Slash::TableMap::table_map->{$name} = "$location";
}
$driver->disconnect();
$Slash::TableMap::dirty=0;
It works perfectly... But, as you can see, I hard-coded the $virtuser
instead of getting the name of the one I need through the proper
channels. Is there an easy way to get the virtuser with out futzing
with the Apache->request object?
Jason
Brian Aker wrote:
> Jason Richey wrote:
> > When I try to initialize my table-map, I used this code:
> > 25 my $r = Apache->request;
> Check to see if $r is really set. Apache->request() is guarenteed
> in a handler because Apache::Registry sets it. You will notice
> that in the top of Slash::Apache::User::handler() that I set
> it. If I didn't then calls that rely on $r will find
> it unet.
>
> -Brian
>
> _______________________________________________
> Slashcode-development mailing list
> Sla...@li...
> http://lists.sourceforge.net/mailman/listinfo/slashcode-development
--
"Jason C. Richey" <ja...@bo...>
|