Apache/AuthCookie/Params/Base.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 43 CC 3 SCAR 17.5
CC
3
Cov
0%
new
12.0
_new_instance
2.0
BEGIN
2.0
CRAP 5.8
1 package Apache::AuthCookie::Params::Base;
2 $Apache::AuthCookie::Params::Base::VERSION = '3.32';
3 # ABSTRACT: Internal CGI AuthCookie Params Base Class
4  
5 use strict;
6 use warnings;
7 use Class::Load qw(load_class);
8 use Apache::AuthCookie::Util qw(is_blank);
9  
10  
11 sub new {
12 my ($class, $r) = @_;
13  
14 my $debug = $r->dir_config("AuthCookieDebug") || 0;
15  
16 # use existing params object if possible
17 my $obj = $r->pnotes($class);
18 if (defined $obj) {
19 return $obj;
20 }
21  
22 # if an encoding is in effect, then always use the ::CGI interface because
23 # libapreq has no support for UTF-8
24 my $auth_name = $r->auth_name;
25  
26 if (!is_blank($r->dir_config("${auth_name}Encoding"))) {
27 $obj = __PACKAGE__->_new_instance($r);
28 }
29 else {
30 $obj = $class->_new_instance($r);
31 }
32  
33 $r->pnotes($class, $obj);
34  
35 return $obj;
36 }
37  
38 sub _new_instance {
39 my ($self, $r) = @_;
40  
41 load_class('Apache::AuthCookie::Params::CGI');
42  
43 return Apache::AuthCookie::Params::CGI->new($r);
44 }
45  
46 1;
47  
48 __END__