RE: push_handlers question

2001-03-05 Thread Geoffrey Young

 -Original Message-
 From: Mike Cameron [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 04, 2001 11:59 PM
 Cc: modperl
 Subject: push_handlers question
 
 
 I am trying to sub class Apache::AuthCookieURL and would like to use
 $r-push_handlers(PerlAuthenHandler = My::Class-authenticate);
 the push_handler is set in a handler called from httpd.conf on the
 PerlInitHandler phase but the authenticate routine does not 
 seem to be getting
 the apache request object passed to it as I get a can't call 
 dir_config on an
 udefined value error.

my $r = Apache-request;

HTH

--Geoff

 
 I'm sure I am missing something simple but can someone point 
 it out to me.
 
 Thanks
 



Re: push_handlers question

2001-03-05 Thread Mike Cameron

Thanks for the suggestion, but what i really want to know is why is the
request object passed if I call the module directly from http.conf and not
when I use the push handlers method? Are the two methods not functionally
equivalent?  Everything works fine when the handler is set in httpd.conf.

Mike

Geoffrey Young wrote:

  -Original Message-
  From: Mike Cameron [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, March 04, 2001 11:59 PM
  Cc: modperl
  Subject: push_handlers question
 
 
  I am trying to sub class Apache::AuthCookieURL and would like to use
  $r-push_handlers(PerlAuthenHandler = My::Class-authenticate);
  the push_handler is set in a handler called from httpd.conf on the
  PerlInitHandler phase but the authenticate routine does not
  seem to be getting
  the apache request object passed to it as I get a can't call
  dir_config on an
  udefined value error.

 my $r = Apache-request;

 HTH

 --Geoff

 
  I'm sure I am missing something simple but can someone point
  it out to me.
 
  Thanks
 




RE: push_handlers question

2001-03-05 Thread Geoffrey Young



 -Original Message-
 From: Mike Cameron [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 05, 2001 10:18 AM
 Cc: '[EMAIL PROTECTED]'
 Subject: Re: push_handlers question
 
 
 Thanks for the suggestion, but what i really want to know is 
 why is the
 request object passed if I call the module directly from 
 http.conf and not
 when I use the push handlers method? Are the two methods not 
 functionally
 equivalent?  Everything works fine when the handler is set in 
 httpd.conf.

according to the mod_perl pocket reference (p20) method handlers do not get
the request object passed to them - Andrew suggests using a closure for
this.  Apache-request should work fine as well.

HTH

--Geoff

 
 Mike
 
 Geoffrey Young wrote:
 
   -Original Message-
   From: Mike Cameron [mailto:[EMAIL PROTECTED]]
   Sent: Sunday, March 04, 2001 11:59 PM
   Cc: modperl
   Subject: push_handlers question
  
  
   I am trying to sub class Apache::AuthCookieURL and would 
 like to use
   $r-push_handlers(PerlAuthenHandler = My::Class-authenticate);
   the push_handler is set in a handler called from httpd.conf on the
   PerlInitHandler phase but the authenticate routine does not
   seem to be getting
   the apache request object passed to it as I get a can't call
   dir_config on an
   udefined value error.
 
  my $r = Apache-request;
 
  HTH
 
  --Geoff
 
  
   I'm sure I am missing something simple but can someone point
   it out to me.
  
   Thanks
  
 



RE: push_handlers question

2001-03-05 Thread Geoffrey Young



 -Original Message-
 From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 05, 2001 9:58 AM
 To: 'Mike Cameron'
 Cc: '[EMAIL PROTECTED]'
 Subject: RE: push_handlers question
 
 
 
 
  -Original Message-
  From: Mike Cameron [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 05, 2001 10:18 AM
  Cc: '[EMAIL PROTECTED]'
  Subject: Re: push_handlers question
  
  
  Thanks for the suggestion, but what i really want to know is 
  why is the
  request object passed if I call the module directly from 
  http.conf and not
  when I use the push handlers method? Are the two methods not 
  functionally
  equivalent?  Everything works fine when the handler is set in 
  httpd.conf.
 
 according to the mod_perl pocket reference (p20) method 
 handlers do not get
 the request object passed to them

I should have said method handlers that are set up via push_handlers() don't
have the request object passed to them.

for normal method handlers,
$self = shift;
$r = shift;

works just fine.

hopefully everyone understood that :)

--Geoff

 - Andrew suggests using a 
 closure for
 this.  Apache-request should work fine as well.
 
 HTH
 
 --Geoff
 
  
  Mike
  
  Geoffrey Young wrote:
  
-Original Message-
From: Mike Cameron [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 04, 2001 11:59 PM
Cc: modperl
Subject: push_handlers question
   
   
I am trying to sub class Apache::AuthCookieURL and would 
  like to use
$r-push_handlers(PerlAuthenHandler = My::Class-authenticate);
the push_handler is set in a handler called from 
 httpd.conf on the
PerlInitHandler phase but the authenticate routine does not
seem to be getting
the apache request object passed to it as I get a can't call
dir_config on an
udefined value error.
  
   my $r = Apache-request;
  
   HTH
  
   --Geoff
  
   
I'm sure I am missing something simple but can someone point
it out to me.
   
Thanks
   
  
 



RE: push_handlers question

2001-03-05 Thread Robert Landrum

At 10:36 AM -0500 3/5/01, Geoffrey Young wrote:
   Thanks for the suggestion, but what i really want to know is
  why is the
  request object passed if I call the module directly from
  http.conf and not
  when I use the push handlers method? Are the two methods not
  functionally
  equivalent?  Everything works fine when the handler is set in
  httpd.conf.

 according to the mod_perl pocket reference (p20) method
 handlers do not get
 the request object passed to them

I should have said method handlers that are set up via push_handlers() don't
have the request object passed to them.

for normal method handlers,
$self = shift;
$r = shift;



Couldn't you fake it?

$r-push_handlers(
 PerlHandler = sub{ unshift @_, Apache-request; goto real_handler; }
);

Robert Landrum


[snip]



--
"Will hack Perl for food."



RE: push_handlers question

2001-03-05 Thread Geoffrey Young



 -Original Message-
 From: Robert Landrum [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 05, 2001 11:19 AM
 To: Geoffrey Young; 'Mike Cameron'
 Cc: [EMAIL PROTECTED]
 Subject: RE: push_handlers question
 
 
 At 10:36 AM -0500 3/5/01, Geoffrey Young wrote:
Thanks for the suggestion, but what i really want to know is
   why is the
   request object passed if I call the module directly from
   http.conf and not
   when I use the push handlers method? Are the two methods not
   functionally
   equivalent?  Everything works fine when the handler is set in
   httpd.conf.
 
  according to the mod_perl pocket reference (p20) method
  handlers do not get
  the request object passed to them
 
 I should have said method handlers that are set up via 
 push_handlers() don't
 have the request object passed to them.
 
 for normal method handlers,
 $self = shift;
 $r = shift;
 
 
 
 Couldn't you fake it?
 
 $r-push_handlers(
  PerlHandler = sub{ unshift @_, Apache-request; goto 
 real_handler; }
 );

there's always more than one way :)

--Geoff

 
 Robert Landrum
 
 
 [snip]
 
 
 
 --
 "Will hack Perl for food."
 



Re: push_handlers question

2001-03-05 Thread Mike Cameron

Thanks all.  My real question was not so much HOW to fix but more WHY do
i need to fix.  I did not realize that using push_handlers would not
send the Apache request to the method handler.

Geoffrey Young wrote:

  -Original Message-
  From: Robert Landrum [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 05, 2001 11:19 AM
  To: Geoffrey Young; 'Mike Cameron'
  Cc: [EMAIL PROTECTED]
  Subject: RE: push_handlers question
 
 
  At 10:36 AM -0500 3/5/01, Geoffrey Young wrote:
 Thanks for the suggestion, but what i really want to know is
why is the
request object passed if I call the module directly from
http.conf and not
when I use the push handlers method? Are the two methods not
functionally
equivalent?  Everything works fine when the handler is set in
httpd.conf.
  
   according to the mod_perl pocket reference (p20) method
   handlers do not get
   the request object passed to them
  
  I should have said method handlers that are set up via
  push_handlers() don't
  have the request object passed to them.
  
  for normal method handlers,
  $self = shift;
  $r = shift;
 
 
 
  Couldn't you fake it?
 
  $r-push_handlers(
   PerlHandler = sub{ unshift @_, Apache-request; goto
  real_handler; }
  );

 there's always more than one way :)

 --Geoff

 
  Robert Landrum
 
 
  [snip]
  
  
 
  --
  "Will hack Perl for food."