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