line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Apache::Voodoo::Session::MySQL; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = "3.0200"; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1659
|
use strict; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
68
|
|
6
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
947
|
use Apache::Session::MySQL; |
|
1
|
|
|
|
|
5474
|
|
|
1
|
|
|
|
|
31
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
8
|
use Apache::Voodoo::Session::Instance; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
269
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
14
|
0
|
|
|
|
|
|
my $conf = shift; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $self = {}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
bless $self,$class; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
$self->{session_table} = $conf->{'session_table'}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub attach { |
26
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
27
|
0
|
|
|
|
|
|
my $id = shift; |
28
|
0
|
|
|
|
|
|
my $dbh = shift; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my %opts = @_; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my %session; |
33
|
|
|
|
|
|
|
my $obj; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$opts{'TableName'} = $self->{'session_table'}; |
36
|
0
|
|
|
|
|
|
$opts{'Handle'} = $dbh; |
37
|
0
|
|
|
|
|
|
$opts{'LockHandle'} = $dbh; |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
0
|
|
|
|
if (defined($id) && $id !~ /^([0-9a-z]+)$/) { |
40
|
0
|
|
|
|
|
|
$id = undef; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
eval { |
44
|
0
|
|
0
|
|
|
|
$obj = tie(%session,'Apache::Session::MySQL',$id, \%opts) || die "Tieing to session failed: $!"; |
45
|
|
|
|
|
|
|
}; |
46
|
0
|
0
|
|
|
|
|
if ($@) { |
47
|
0
|
|
|
|
|
|
undef $id; |
48
|
0
|
|
0
|
|
|
|
$obj = tie(%session,'Apache::Session::MySQL',$id, \%opts) || die "Tieing to session failed: $!"; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return Apache::Voodoo::Session::Instance->new($obj,\%session); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
################################################################################ |
57
|
|
|
|
|
|
|
# Copyright (c) 2005-2010 Steven Edwards (maverick@smurfbane.org). |
58
|
|
|
|
|
|
|
# All rights reserved. |
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
# You may use and distribute Apache::Voodoo under the terms described in the |
61
|
|
|
|
|
|
|
# LICENSE file include in this package. The summary is it's a legalese version |
62
|
|
|
|
|
|
|
# of the Artistic License :) |
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
################################################################################ |