Apache/Application/Plus.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 8 / 8 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Apache/Application/Magic.pm ↑ Summary CGI/Application/Magic.pm »
1 package Apache::Application::Plus ;
2 $VERSION = 1.21 ;
3 1 ▶use strict ;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # This file uses the "Perlish" coding style
6 # please read http://perl.4pro.net/perlish_coding_style.html
7  
8 1 ▶; use base 'CGI::Application::Plus'
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ; use mod_perl
10 ; use constant MP2 => $mod_perl::VERSION >= 1.99
11  
12 ; BEGIN
13 { require File::Basename
14 ; if ( MP2 )
15 { require Apache::RequestRec
16 ; require Apache::Response
17 ; require Apache::Const
18 ; Apache::Const->import( -compile => 'OK' )
19 ; *handler = sub : method { shift()->_mp_run(@_) }
20 }
21 else
22 { require Apache::Constants
23 ; Apache::Constants->import( 'OK' )
24 ; *handler = sub ($$) { shift()->_mp_run(@_) }
25 }
26 }
27  
28 ; use Object::props
29 ( { name => 'request'
30 , allowed => qr/::new_object$/
31 }
32 )
33
34 ; sub _mp_run
35 { my ($s, $r) = @_
36 ; $s = $s->new_object($r) unless ref $s
37 ; $s->run()
38 ; MP2 ? Apache::OK : Apache::Constants::OK
39 }
40  
41 ; sub _split_filename
42 { File::Basename::fileparse( $_[1]->filename
43 , qr/\.[^.]+$/
44 )
45 }
46  
47 ; sub new_object
48 { my ($c, $r) = @_
49 ; my $RM = $c->_split_filename($r)
50 ; $c->new( runmode => $RM
51 , request => $r
52 )
53 }
54  
55 ; 1
56  
57  
58 __END__
« Apache/Application/Magic.pm ↑ Summary CGI/Application/Magic.pm »