| 1 | package Apache2::Controller::NonResponseRequest; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Apache2::Controller::NonResponseRequest - internal base class w/ apreq for | ||
| 6 | non-response handlers in Apache2::Controller framework | ||
| 7 | |||
| 8 | =head1 VERSION | ||
| 9 | |||
| 10 | Version 1.001.001 | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | 2 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | our $VERSION = version->new('1.001.001'); | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | This is an INTERNAL base class and you don't need to use it. | ||
| 20 | |||
| 21 | package Apache2::Controller; | ||
| 22 | use base Apache2::Controller::NonResponseRequest; | ||
| 23 | |||
| 24 | # no need to define handler() or new() | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | This is like L<Apache2::Controller::NonResponseBase> except | ||
| 31 | that it creates the L<Apache2::Request> object and makes C<< $self >> | ||
| 32 | an inheriting subclass of it. So using this as a base, there is | ||
| 33 | no need to dereference C<< $self->{r} >> to get at the request. | ||
| 34 | It is all C<< $self >> just like within L<Apache2::Controller> | ||
| 35 | controller modules. | ||
| 36 | |||
| 37 | You should not use this module for anything that you're doing. | ||
| 38 | |||
| 39 | =head1 METHODS | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 2 | ▶ | use warnings FATAL => 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | 2 | ▶ | use English '-no_match_vars'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | |||
| 47 | 2 | ▶ | use base qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | Apache2::Controller::NonResponseBase | ||
| 49 | Apache2::Controller::Methods | ||
| 50 | Apache2::Request | ||
| 51 | 2 | ); | |
| 52 | |||
| 53 | use Log::Log4perl qw(:easy); | ||
| 54 | use YAML::Syck; | ||
| 55 | |||
| 56 | use Apache2::RequestRec (); | ||
| 57 | use Apache2::RequestUtil (); | ||
| 58 | use Apache2::Log; | ||
| 59 | use Apache2::URI; | ||
| 60 | use Apache2::Const -compile => qw( :common :http :methods ); | ||
| 61 | |||
| 62 | use Apache2::Controller::X; | ||
| 63 | use Apache2::Controller::Const qw( @RANDCHARS $NOT_GOOD_CHARS ); | ||
| 64 | use Apache2::Controller::Funk qw( log_bad_request_reason ); | ||
| 65 | |||
| 66 | =head2 new | ||
| 67 | |||
| 68 | C<new()> creates an object of the child class using | ||
| 69 | L<Apache2::Controller::NonResponseBase> and then assigns the | ||
| 70 | C<< Apache2::Request >> object to C<< $self->{r} >>. | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | sub new { | ||
| 75 | my ($class, $r) = @_; | ||
| 76 | |||
| 77 | # note the '::' in call to new, not '->' ... we have to trick the class | ||
| 78 | my $self = Apache2::Controller::NonResponseBase::new($class, $r); | ||
| 79 | |||
| 80 | $class = $self->{class}; | ||
| 81 | |||
| 82 | DEBUG("Created NonResponseBase of class '$class'"); | ||
| 83 | |||
| 84 | $self->{r} = Apache2::Request->new( $self->{r},); | ||
| 85 | |||
| 86 | DEBUG("Replaced self->{r} with Apache2::Request object"); | ||
| 87 | |||
| 88 | return $self; | ||
| 89 | } | ||
| 90 | |||
| 91 | 1; | ||
| 92 | |||
| 93 | =head1 SEE ALSO | ||
| 94 | |||
| 95 | L<Apache2::Controller::NonResponseBase> | ||
| 96 | |||
| 97 | L<Apache2::Request> | ||
| 98 | |||
| 99 | L<Apache2::RequestRec> | ||
| 100 | |||
| 101 | L<Apache2::Controller::Auth::OpenID> (uses this as base) | ||
| 102 | |||
| 103 | L<Apache2::Controller> | ||
| 104 | |||
| 105 | =head1 AUTHOR | ||
| 106 | |||
| 107 | Mark Hedges, C<< <hedges at formdata.biz> >> | ||
| 108 | |||
| 109 | =head1 COPYRIGHT & LICENSE | ||
| 110 | |||
| 111 | Copyright 2008-2010 Mark Hedges, all rights reserved. | ||
| 112 | |||
| 113 | This program is free software; you can redistribute it and/or modify it | ||
| 114 | under the same terms as Perl itself. | ||
| 115 | |||
| 116 | This software is provided as-is, with no warranty | ||
| 117 | and no guarantee of fitness | ||
| 118 | for any particular purpose. | ||
| 119 | |||