line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package URI::_redis; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
78
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
9
|
use base qw( URI::_login ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
9248
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub host { |
11
|
5
|
|
|
5
|
1
|
2857
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
100
|
|
|
32
|
return $self->SUPER::host(@_) || 'localhost'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
1
|
863
|
sub default_port { 6379 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub database { |
19
|
8
|
|
|
8
|
0
|
3841
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
8
|
|
100
|
|
|
36
|
return $self->database_from_path || $self->database_from_query || 0; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub database_from_path { |
25
|
10
|
|
|
10
|
0
|
3060
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
|
|
80
|
my ($database) = $self->path =~ m{ ^ / (\d+) $ }x; |
28
|
|
|
|
|
|
|
|
29
|
10
|
|
|
|
|
203
|
return $database; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub database_from_query { |
33
|
14
|
|
|
14
|
0
|
3652
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
14
|
|
|
|
|
53
|
return { $self->query_form }->{db}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub password { |
39
|
8
|
|
|
8
|
0
|
21077
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
8
|
|
100
|
|
|
33
|
return $self->password_from_userinfo || $self->password_from_query; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub password_from_userinfo { |
45
|
16
|
|
|
16
|
0
|
4343
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
16
|
100
|
|
|
|
69
|
my $userinfo = $self->userinfo |
48
|
|
|
|
|
|
|
or return; |
49
|
|
|
|
|
|
|
|
50
|
6
|
|
|
|
|
242
|
my ($password) = $userinfo =~ m{ ^ .* : ([^@]+) }x; |
51
|
|
|
|
|
|
|
|
52
|
6
|
|
|
|
|
37
|
return $password; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub password_from_query { |
56
|
13
|
|
|
13
|
0
|
4153
|
my $self = shift; |
57
|
|
|
|
|
|
|
|
58
|
13
|
|
|
|
|
57
|
return { $self->query_form }->{password}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub socket_path { |
62
|
3
|
|
|
3
|
0
|
1119
|
my $self = shift; |
63
|
|
|
|
|
|
|
|
64
|
3
|
|
|
|
|
14
|
return $self->path; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |