line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Admin::Session; |
2
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
41
|
|
3
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
32
|
|
4
|
2
|
|
|
2
|
|
6
|
use utf8; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
2
|
|
|
2
|
|
45
|
use vars qw( $session $DefaultClass @EXPORT @ISA $defaultconfig); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
123
|
|
7
|
|
|
|
|
|
|
@MySQL::Admin::Session::EXPORT = qw(loadSession saveSession $session); |
8
|
2
|
|
|
2
|
|
7
|
use MySQL::Admin::Config; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
579
|
|
9
|
|
|
|
|
|
|
@MySQL::Admin::Session::ISA = qw(Exporter MySQL::Admin::Config); |
10
|
|
|
|
|
|
|
$MySQL::Admin::Session::VERSION = '1.12'; |
11
|
|
|
|
|
|
|
$DefaultClass = 'MySQL::Admin::Session' unless defined $MySQL::Admin::Session::DefaultClass; |
12
|
|
|
|
|
|
|
$defaultconfig = '%CONFIG%'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
MySQL::Admin::Session - store the sessions for MySQL::Admin |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
see l |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
session for MySQL::Admin. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 EXPORT |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
loadConfig() saveSession() $session |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 Public |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 new |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
2
|
|
|
2
|
1
|
4
|
my ($class, @initializer) = @_; |
38
|
2
|
|
|
|
|
3
|
my $self = {}; |
39
|
2
|
|
33
|
|
|
13
|
bless $self, ref $class || $class || $DefaultClass; |
40
|
2
|
|
|
|
|
5
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 loadSession |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
load session via do from disk. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub loadSession { |
50
|
2
|
|
|
2
|
1
|
10
|
my ($self, @p) = getSelf(@_); |
51
|
2
|
50
|
|
|
|
7
|
my $do = (defined $p[0]) ? $p[0] : $defaultconfig; |
52
|
2
|
50
|
|
|
|
21
|
if (-e $do) { do $do; } |
|
0
|
|
|
|
|
0
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 saveSession |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub saveSession { |
60
|
0
|
|
|
0
|
1
|
0
|
my ($self, @p) = getSelf(@_); |
61
|
0
|
0
|
|
|
|
0
|
my $l = defined $p[0] ? $p[0] : $defaultconfig; |
62
|
0
|
|
|
|
|
0
|
$self->SUPER::saveConfig($l, $session, 'session'); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 Private |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 getSelf |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub getSelf { |
72
|
2
|
0
|
33
|
2
|
1
|
7
|
return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Session'); |
|
|
|
33
|
|
|
|
|
73
|
2
|
50
|
33
|
|
|
20
|
return (defined($_[0]) |
74
|
|
|
|
|
|
|
&& (ref($_[0]) eq 'MySQL::Admin::Session' |
75
|
|
|
|
|
|
|
|| UNIVERSAL::isa($_[0], 'MySQL::Admin::Session'))) |
76
|
|
|
|
|
|
|
? @_ |
77
|
|
|
|
|
|
|
: ($MySQL::Admin::Session::DefaultClass->new, @_); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Dirk Lindner |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 see Also |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L L L L L L |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 LICENSE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Copyright (C) 2005-2015 by Hr. Dirk Lindner |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
93
|
|
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public License |
94
|
|
|
|
|
|
|
as published by the Free Software Foundation; |
95
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
96
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
97
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
98
|
|
|
|
|
|
|
GNU Lesser General Public License for more details. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |