line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Apache::Session::Lazy; |
2
|
1
|
|
|
1
|
|
12219
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
1134
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Thanks for the perltie info, Merlyn. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub TIEHASH { |
10
|
0
|
|
|
0
|
|
|
my $class = shift; |
11
|
0
|
0
|
|
|
|
|
return unless checks(@_); |
12
|
|
|
|
|
|
|
|
13
|
0
|
0
|
|
|
|
|
if ( $@ ) { # whoops, there was an error |
14
|
0
|
|
|
|
|
|
warn( $@ ); # require'ing $class; perhaps |
15
|
0
|
|
|
|
|
|
return; # it doesn't exist? |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
0
|
|
|
|
if ( ( caller(1) )[3] eq '(eval)' && defined $_[1]) { # The assumption is |
19
|
0
|
|
|
|
|
|
my $object = $_[0]->TIEHASH( $_[1..$#_] ); # that you are checking |
20
|
0
|
|
|
|
|
|
$object->DESTROY(); # to see if a session |
21
|
|
|
|
|
|
|
} # exists. |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
bless [@_], $class; # remember real args |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub FETCH { |
27
|
|
|
|
|
|
|
## DO NOT USE shift HERE |
28
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
goto &{$_[0]->can("FETCH")}; |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub STORE { |
33
|
|
|
|
|
|
|
## DO NOT USE shift HERE |
34
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
goto &{$_[0]->can("STORE")}; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub DELETE { |
39
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
goto &{$_[0]->can("DELETE")}; |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub CLEAR { |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
0
|
0
|
|
|
if ( defined $_[0]->[1] && $_[0]->[1] ) { # Why Clear An Uncreated Sesion? |
46
|
0
|
|
|
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
goto &{$_[0]->can("CLEAR")}; |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub EXISTS { |
53
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
goto &{$_[0]->can("EXISTS")}; |
|
0
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub FIRSTKEY { |
58
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
goto &{$_[0]->can("FIRSTKEY")}; |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub NEXTKEY { |
63
|
0
|
|
|
0
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
goto &{$_[0]->can("NEXTKEY")}; |
|
0
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub DESTROY { |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
0
|
0
|
|
|
if ( defined $_[0]->[1] && $_[0]->[1] ) { # Why Destroy An Uncreated Sesion? |
70
|
0
|
|
|
|
|
|
$_[0] = delete($_[0]->[0])->TIEHASH(@{$_[0]}); |
|
0
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
goto &{$_[0]->can("DESTROY")}; |
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub checks { |
77
|
0
|
|
|
0
|
0
|
|
eval "require $_[0]"; # You can overload this. |
78
|
0
|
|
|
|
|
|
!$@; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
__END__ |