line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Lazy::ModPerl; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6129
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use CGI::Lazy::Globals; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
129
|
|
7
|
1
|
|
|
1
|
|
644
|
use Apache2::Const; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Apache2::RequestUtil; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
no warnings qw(uninitialized redefine); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
15
|
|
|
|
|
|
|
sub _sessionCleanup { |
16
|
|
|
|
|
|
|
my $r = shift; |
17
|
|
|
|
|
|
|
my $q = shift; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
if ($q->plugin->session) { |
20
|
|
|
|
|
|
|
unless ($q->plugin->session->{saveOnDestroy} == 0) { |
21
|
|
|
|
|
|
|
$q->session->save if $q->session; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return Apache2::Const::OK; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
30
|
|
|
|
|
|
|
sub new { |
31
|
|
|
|
|
|
|
my $class = shift; |
32
|
|
|
|
|
|
|
my $q = shift; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $vars = $q->plugin->mod_perl; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
if ($q->plugin->session) { |
37
|
|
|
|
|
|
|
#register cleanup handler, so we make damn sure that the session variable is saved |
38
|
|
|
|
|
|
|
my $handler = $q->plugin->mod_perl->{PerlHandler}; |
39
|
|
|
|
|
|
|
my $r = Apache2::RequestUtil->request(); |
40
|
|
|
|
|
|
|
$r->push_handlers(PerlCleanupHandler => \&_sessionCleanup($r, $q)); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
return bless {_q => $q, _vars => $vars}, $class; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
47
|
|
|
|
|
|
|
sub vars { |
48
|
|
|
|
|
|
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
return $self->{_vars}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |