| 1 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | package Siesta::Web::FakeApache; | ||
| 3 | 1 | ▶ | use base 'Class::Accessor::Fast'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | __PACKAGE__->mk_accessors(qw( filename uri headers content_type )); | |
| 5 | |||
| 6 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 7 | 0 | my $class = shift; | |
| 8 | 0 | if (0) { | |
| 9 | require YAML; | ||
| 10 | require CGI; | ||
| 11 | print CGI->header('text/plain'); | ||
| 12 | print YAML::Dump(\%ENV ); | ||
| 13 | exit; | ||
| 14 | } | ||
| 15 | $class->SUPER::new({ | ||
| 16 | filename => "$ENV{DOCUMENT_ROOT}/$ENV{SCRIPT_NAME}", # this is fragile | ||
| 17 | uri => $ENV{REQUEST_URI}, | ||
| 18 | 0 | headers => [], | |
| 19 | content_type => 'text/html', | ||
| 20 | }); | ||
| 21 | } | ||
| 22 | |||
| 23 | 0 | ▶ | sub header_out { |
|
Subroutine
header_out: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 24 | 0 | my $self = shift; | |
| 25 | 0 | push @{ $self->headers }, [ @_ ]; | |
| 26 | } | ||
| 27 | |||
| 28 | 0 | ▶ | sub send_http_header { |
|
Subroutine
send_http_header: not called CC=2 SCAR=17.9
Pod
undocumented
| |||
| 29 | 0 | my $self = shift; | |
| 30 | 0 | print "Content-Type: ", $self->content_type, "\r\n"; | |
| 31 | 0 | print "$_->[0]: $_->[1]\r\n" for @{ $self->headers }; | |
| 32 | 0 | print "\r\n"; | |
| 33 | } | ||
| 34 | |||
| 35 | 0 | ▶ | sub print { |
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 36 | 0 | my $self = shift; | |
| 37 | 0 | print @_; | |
| 38 | } | ||
| 39 | |||
| 40 | 0 | ▶ | sub log_reason { |
|
Subroutine
log_reason: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 41 | 0 | shift; | |
| 42 | 0 | print STDERR @_; | |
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 | package Apache::Constants; | ||
| 47 | 1 | $INC{'Apache/Constants.pm'} = 1; | |
| 48 | 1 | ▶ | sub import { |
|
Subroutine
import: called CC=2 SCAR=6.9
| |||
| 49 | 1 | my $caller = caller; | |
| 50 | 1 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 51 | 1 | ▶ | *{"$caller\::$_"} = sub {} for qw( DECLINED SERVER_ERROR OK ); |
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||
| 52 | } | ||
| 53 | 1 | 1; | |