File Coverage

lib/Egg/Request/Apache.pm
Criterion Covered Total %
statement 18 29 62.0
branch n/a
condition 0 6 0.0
subroutine 6 9 66.6
pod 1 1 100.0
total 25 45 55.5


line stmt bran cond sub pod time code
1             package Egg::Request::Apache;
2             #
3             # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
4             #
5             # $Id: Apache.pm 337 2008-05-14 12:30:09Z lushe $
6             #
7 1     1   415 use strict;
  1         2  
  1         41  
8 1     1   7 use warnings;
  1         2  
  1         34  
9 1     1   5 use Carp qw/ croak /;
  1         2  
  1         58  
10 1     1   6 use base qw/ Egg::Request::handler /;
  1         1  
  1         473  
11              
12             our $VERSION= '3.00';
13              
14             sub _init_handler {
15 0     0     my($class, $e)= @_;
16 0           my $p= $e->namespace;
17 1     1   4 no strict 'refs'; ## no critic.
  1         2  
  1         21  
18 1     1   5 no warnings 'redefine';
  1         1  
  1         156  
19 0     0     *{$e->namespace. '::handler'}= sub : method { shift->run(@_) };
  0            
  0            
20 0           @_;
21             }
22             sub output {
23 0     0 1   my $req = shift;
24 0   0       my $header= shift || croak q{ I want response header. };
25 0   0       my $body = shift || croak q{ I want response body. };
26 0           $req->r->send_cgi_header($$header);
27 0           $req->r->print($$body);
28             }
29              
30             1;
31              
32             __END__
33              
34             =head1 NAME
35              
36             Egg::Request::Apache - Request class for mod_perl.
37              
38             =head1 DESCRIPTION
39              
40             It is a base class for
41             L<Egg::Request::Apache::MP13>,
42             L<Egg::Request::Apache::MP19>,
43             L<Egg::Request::Apache::MP20>.
44              
45             =head1 HANDLER METHODS
46              
47             =head2 output ([HEADER_REF], [BODY_REF])
48              
49             Override does the method of Egg::Request::handler.
50              
51             The output and print of the request header are done on the object side of mod_perl.
52              
53             =head1 SEE ALSO
54              
55             L<Egg::Release>,
56             L<Egg::Request>,
57             L<Egg::Request::Apache::MP13>,
58             L<Egg::Request::Apache::MP19>,
59             L<Egg::Request::Apache::MP20>,
60              
61             =head1 AUTHOR
62              
63             Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             Copyright (C) 2008 Bee Flag, Corp. E<lt>L<http://egg.bomcity.com/>E<gt>.
68              
69             This library is free software; you can redistribute it and/or modify
70             it under the same terms as Perl itself, either Perl version 5.8.6 or,
71             at your option, any later version of Perl 5 you may have available.
72              
73             =cut
74