line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Nephia::Plugin::PlackSession; |
2
|
2
|
|
|
2
|
|
422947
|
use 5.008005; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
86
|
|
3
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
70
|
|
4
|
2
|
|
|
2
|
|
23
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
78
|
|
5
|
2
|
|
|
2
|
|
694
|
use parent 'Nephia::Plugin'; |
|
2
|
|
|
|
|
265
|
|
|
2
|
|
|
|
|
19
|
|
6
|
2
|
|
|
2
|
|
1996
|
use Plack::Session; |
|
2
|
|
|
|
|
1398
|
|
|
2
|
|
|
|
|
472
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "0.81"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub exports { |
11
|
3
|
|
|
3
|
1
|
99161
|
qw/ session /; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub session { |
15
|
6
|
|
|
6
|
0
|
45
|
my ($self, $context) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return sub { |
18
|
4
|
|
|
4
|
|
200
|
my $session = $context->get('sessions'); |
19
|
4
|
100
|
|
|
|
24
|
if (defined $session) { |
20
|
2
|
|
|
|
|
11
|
return $session; |
21
|
|
|
|
|
|
|
} else { |
22
|
2
|
|
|
|
|
5
|
my $req = $context->get('req'); |
23
|
2
|
|
|
|
|
17
|
$session = Plack::Session->new($req->env); |
24
|
2
|
|
|
|
|
34
|
$context->set(sessions => $session); |
25
|
2
|
|
|
|
|
17
|
return $session; |
26
|
|
|
|
|
|
|
} |
27
|
6
|
|
|
|
|
99
|
}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |