getting current phase / PerlOptions in Location

2006-10-25 Thread John ORourke

Hi folks,

I can't find anything in the docs (not really sure what to look for) - I 
want to retrieve the current phase from within a handler.


Basically I'm trying to implement a per-directory PerlOptions type 
directive, so I can turn phase handlers on and off per-directory not 
just per-server.


I'm looking at calling a single method at the top of each handler to see 
if the handler should run, but it would need to say something like


   if ( $r-phase() eq 'Fixup' ) { ...

anyone know how I can get that?

cheers
John



RE: getting current phase / PerlOptions in Location

2006-10-25 Thread Adam Prime x443
$r-current_callback() in 1.3. (thanks geoff/mpcookbook)
Modperl::current_callback() in 2.0. (thanks google)

returns 'PerlAccessHandler' or similiar.


-Original Message-
From: John ORourke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 25, 2006 9:49 AM
To: mod_perl List
Subject: getting current phase / PerlOptions in Location

Hi folks,

I can't find anything in the docs (not really sure what to look for) - I

want to retrieve the current phase from within a handler.

Basically I'm trying to implement a per-directory PerlOptions type 
directive, so I can turn phase handlers on and off per-directory not 
just per-server.

I'm looking at calling a single method at the top of each handler to see

if the handler should run, but it would need to say something like

if ( $r-phase() eq 'Fixup' ) { ...

anyone know how I can get that?

cheers
John




RE: getting current phase / PerlOptions in Location

2006-10-25 Thread Adam Prime x443
That should be ModPerl::Util::current_callback for 2.0.

-Original Message-
From: Adam Prime x443 
Sent: Wednesday, October 25, 2006 10:54 AM
To: John ORourke; mod_perl List
Subject: RE: getting current phase / PerlOptions in Location

$r-current_callback() in 1.3. (thanks geoff/mpcookbook)
Modperl::current_callback() in 2.0. (thanks google)

returns 'PerlAccessHandler' or similiar.


-Original Message-
From: John ORourke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 25, 2006 9:49 AM
To: mod_perl List
Subject: getting current phase / PerlOptions in Location

Hi folks,

I can't find anything in the docs (not really sure what to look for) - I

want to retrieve the current phase from within a handler.

Basically I'm trying to implement a per-directory PerlOptions type 
directive, so I can turn phase handlers on and off per-directory not 
just per-server.

I'm looking at calling a single method at the top of each handler to see

if the handler should run, but it would need to say something like

if ( $r-phase() eq 'Fixup' ) { ...

anyone know how I can get that?

cheers
John






Re: getting current phase / PerlOptions in Location

2006-10-25 Thread John ORourke

Thanks Adam, not sure why but I didn't look under ModPerl::Util::

Adam Prime x443 wrote:


That should be ModPerl::Util::current_callback for 2.0.
 





RE: When is perl.apache.org going to be back online?

2006-10-25 Thread Adam Prime x443
Every project site on apache.org except perl.apache.org and
tcl.apache.org are now up.  

Is this something someone should be concerned about? 

Adam

-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 24, 2006 10:53 AM
To: James Davis
Cc: modperl@perl.apache.org
Subject: Re: When is perl.apache.org going to be back online?

On Sun, 2006-10-22 at 17:00 -0400, James Davis wrote:
 I have not been able to access perl.apache.org for two days. I cannot 
 ping, receive host unreachable.
 
 Do you know when the site will be back online?

It's being moved to a new data center.  If you're looking for the docs,
they are mirrored here:
http://theoryx5.uwinnipeg.ca/modperl/

The releases can be downloaded from CPAN.  Does that help you for now?

- Perrin




Re: Transhandler? Redirect permanent?

2006-10-25 Thread Jonathan


On Oct 25, 2006, at 9:48 PM, Will Fould wrote:

I've started testing a handler (configured at '/') that parses $r- 
uri and checks the object, doing a redirect accordingly, but this  
seems wasteful for every hit.

I've thought about using the handler for only 404...



Personally, i use a dispatch table and dispatch regex system --  
sample organization code below


i see if a stripped uri is in the dispatch, if its not i loop/recurse  
regex trees looking for  matches/better matches


if i get nothing, then i go 404

the static and regex lookups are negligible.   i think they're like  
1/5 seconds, or soemthing ridiculously fast like that on my  
slowest box




use constant URL_Dispatch= {
'/'= 'FindMeOn::Syndicate::Base::Default',
'_default'= 'FindMeOn::Syndicate::Base::Default',
'/findmeon/visit/'= 'FindMeOn::Syndicate::Base::Findmeon::Visit',
};

use constant URL_RegexDispatch= [
{
regex= qr/^\/findmeon\//,
sections= [
# findmeon-embeds , links
{
'regex' = 
qr/^\/findmeon\/findmeons\/([\w]{32})\/v1(:?\/)?$/,
'package'   = 
'FindMeOn::Syndicate::Base::Findmeon::Findmeons::v1',
'id_fields'= ['hex_id']
},
}
];

// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -

| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -

| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -





Re: Transhandler? Redirect permanent?

2006-10-25 Thread Tyler MacDonald
Will Fould [EMAIL PROTECTED] wrote:
 I've started testing a handler (configured at '/') that parses $r-uri and
 checks the object, doing a redirect accordingly, but this seems wasteful for
 every hit.
 I've thought about using the handler for only 404...
 
 How can this most effeciently be handled using the virtual name?

mod_perl is great if you want to make complex decisions to arrive at
the dynamic document in question, but if you just want to provide mappings
based on a simple key/value table, I strongly suggest you use mod_rewrite.
Here's a good starting point for that:

http://httpd.apache.org/docs/2.2/rewrite/

The advantage is that in most cases, you end up with 2 or 3 lines of
code inline in your httpd.conf to handle the problem, instead of the
mod_perl way of writing a separate .pm with a handler whose overhead is
going to be at least 10 lines before you even start coding.

I use both extensively and together; mod_perl for the content,
authentication, etc... and mod_rewrite for traffic control.

Cheers,
Tyler



Re: When is perl.apache.org going to be back online?

2006-10-25 Thread Philip M. Gollucci

this one time in band camp Adam Prime x443 said on 10/25/06 12:17:

Every project site on apache.org except perl.apache.org and
tcl.apache.org are now up.  

No, We(including I) are aware and working on it.  Its intentional.

Its still data center movement issues, server is single user mode atm
while we transfer some things to faster disks.

ETA: midnight.


--

Philip M. Gollucci ([EMAIL PROTECTED]) 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