| 1 | package Puzzle::Request; | ||
| 2 | |||
| 3 | our $VERSION = '0.01'; | ||
| 4 | |||
| 5 | use base 'HTML::Mason::Request'; | ||
| 6 | |||
| 7 | use Params::Validate; | ||
| 8 | |||
| 9 | my $ap_req_class = HTML::Mason::Request::Apachehandler::APACHE2 | ||
| 10 | ? 'Apache2::RequestRec' : 'Apache'; | ||
| 11 | |||
| 12 | |||
| 13 | __PACKAGE__->valid_params | ||
| 14 | ( ah => { isa => 'HTML::Mason::ApacheHandler', | ||
| 15 | descr => 'An ApacheHandler to handle web requests', | ||
| 16 | public => 0 }, | ||
| 17 | apache_req => { isa => $ap_req_class, default => undef, | ||
| 18 | descr => "An Apache request object", | ||
| 19 | public => 0 }, | ||
| 20 | ); | ||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | sub new { | ||
| 25 | my $class = shift; | ||
| 26 | $class->alter_superclass( $HTML::Mason::ApacheHandler::VERSION ? | ||
| 27 | 'HTML::Mason::Request::ApacheHandler' : | ||
| 28 | $HTML::Mason::CGIHandler::VERSION ? | ||
| 29 | 'HTML::Mason::Request::CGI' : | ||
| 30 | 'HTML::Mason::Request' ); | ||
| 31 | |||
| 32 | my $self = $class->SUPER::new(@_); | ||
| 33 | return $self; | ||
| 34 | } | ||
| 35 | |||
| 36 | 1; |