Puzzle/MasonHandler.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 55 CC 4 SCAR 20.2
CC
4
Cov
0%
handler
20.0
params
2.0
BEGIN
2.0
CRAP 7.5
1 package Puzzle::MasonHandler;
2  
3 our $VERSION = '0.21';
4  
5 use HTML::Mason::ApacheHandler();
6  
7 use strict;
8  
9 {
10 package Puzzle::Request;
11 use Apache2::Request;
12 use Apache2::Cookie;
13 use Apache::DBI;
14 use Apache::Session::MySQL;
15 use I18N::AcceptLanguage;
16 use HTML::Template::Pro::Extension;
17 }
18  
19 my %perl2apache = (
20 args_method => 'MasonArgsMethod',
21 comp_root => 'MasonCompRoot',
22 data_dir => 'MasonDataDir',
23 code_cache_max_size => 'MasonCodeCacheMaxSize',
24 autoflush => 'MasonAutoflush',
25 dhandler_name => 'MasonDhandlerName',
26 request_class => 'MasonRequestClass',
27 error_mode => 'MasonErrorMode',
28 static_source => 'MasonStaticSource',
29 );
30  
31 my %ah;
32  
33 sub params {return (
34 args_method => 'mod_perl',
35 comp_root => "/www/$_[0]/www",
36 data_dir => "/var/cache/mason/cache/$_[0]",
37 code_cache_max_size => 0,
38 autoflush => 0,
39 dhandler_name => 'dhandler.mpl',
40 request_class => 'Puzzle::Request',
41 error_mode => 'output',
42 static_source => 0,
43 )};
44  
45 sub handler {
46 my ($r) = @_;
47 my $sn = $r->dir_config('ServerName');
48 my %params = &params($sn);
49 foreach my $key (keys %params) {
50 if (exists $perl2apache{$key}) {
51 $params{$key} = $r->dir_config($perl2apache{$key})
52 if ($r->dir_config($perl2apache{$key}));
53 }
54 }
55 $ah{$sn} = new HTML::Mason::ApacheHandler(%params) unless (exists $ah{$sn});
56 return $ah{$sn}->handle_request($r);
57 }
58  
59 1;
60  
61 # vim: set ts=2: