line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::DisconnectAll; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
87480
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
73
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
62
|
|
5
|
2
|
|
|
2
|
|
1664
|
use parent 'Exporter'; |
|
2
|
|
|
|
|
613
|
|
|
2
|
|
|
|
|
10
|
|
6
|
2
|
|
|
2
|
|
5042
|
use DBI; |
|
2
|
|
|
|
|
24301
|
|
|
2
|
|
|
|
|
391
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/dbi_disconnect_all/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub dbi_disconnect_all { |
13
|
1
|
|
|
1
|
0
|
5931
|
my %dr = DBI->installed_drivers(); |
14
|
1
|
|
|
|
|
7
|
keys %dr; |
15
|
1
|
|
|
|
|
4
|
for my $dr ( values %dr ) { |
16
|
2
|
50
|
33
|
|
|
51
|
if ( $dr->{ChildHandles} |
|
|
|
33
|
|
|
|
|
17
|
|
|
|
|
|
|
&& ref($dr->{ChildHandles}) |
18
|
|
|
|
|
|
|
&& ref($dr->{ChildHandles}) eq 'ARRAY' |
19
|
|
|
|
|
|
|
) { |
20
|
2
|
|
|
|
|
4
|
$_->disconnect for grep { UNIVERSAL::isa($_, 'DBI::db') } @{$dr->{ChildHandles}}; |
|
2
|
|
|
|
|
47
|
|
|
2
|
|
|
|
|
16
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |