line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package URI::redis; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
176354
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
49
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
79
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
9
|
use base qw( URI::_login ); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
1582
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub host { |
11
|
5
|
|
|
5
|
1
|
1747
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
100
|
|
|
19
|
return $self->SUPER::host(@_) || 'localhost'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
1
|
394
|
sub default_port { 6379 } |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
5
|
1
|
3372
|
sub socket_path { undef } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub database { |
21
|
8
|
|
|
8
|
1
|
2363
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
8
|
|
100
|
|
|
22
|
return $self->database_from_path || $self->database_from_query || 0; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub database_from_path { |
27
|
10
|
|
|
10
|
1
|
1839
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
10
|
|
|
|
|
31
|
my ($database) = $self->path =~ m{ ^ / (\d+) $ }x; |
30
|
|
|
|
|
|
|
|
31
|
10
|
|
|
|
|
141
|
return $database; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub database_from_query { |
35
|
14
|
|
|
14
|
1
|
2309
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
14
|
|
|
|
|
39
|
return { $self->query_form }->{db}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub password { |
41
|
8
|
|
|
8
|
1
|
12400
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
8
|
|
100
|
|
|
22
|
return $self->password_from_userinfo || $self->password_from_query; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub password_from_userinfo { |
47
|
16
|
|
|
16
|
1
|
2909
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
16
|
100
|
|
|
|
50
|
my $userinfo = $self->userinfo |
50
|
|
|
|
|
|
|
or return; |
51
|
|
|
|
|
|
|
|
52
|
6
|
|
|
|
|
186
|
my ($password) = $userinfo =~ m{ ^ .* : ([^@]+) }x; |
53
|
|
|
|
|
|
|
|
54
|
6
|
|
|
|
|
32
|
return $password; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub password_from_query { |
58
|
13
|
|
|
13
|
1
|
2536
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
13
|
|
|
|
|
47
|
return { $self->query_form }->{password}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |