line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Admin::Settings; |
2
|
2
|
|
|
2
|
|
375
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
42
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
32
|
|
4
|
2
|
|
|
2
|
|
458
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
2
|
|
|
2
|
|
58
|
use vars qw($m_hrSettings $DefaultClass @EXPORT @ISA $defaultconfig); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
150
|
|
7
|
|
|
|
|
|
|
@MySQL::Admin::Settings::EXPORT = qw(loadSettings saveSettings $m_hrSettings); |
8
|
2
|
|
|
2
|
|
613
|
use MySQL::Admin::Config; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
610
|
|
9
|
|
|
|
|
|
|
@ISA = qw(Exporter MySQL::Admin::Config); |
10
|
|
|
|
|
|
|
$MySQL::Admin::Settings::VERSION = '1.12'; |
11
|
|
|
|
|
|
|
$DefaultClass = 'MySQL::Admin::Settings' unless defined $MySQL::Admin::Settings::DefaultClass; |
12
|
|
|
|
|
|
|
$defaultconfig = '/var/www/cgi-bin/config/settings.pl'; |
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
|
6
|
|
|
6
|
1
|
10
|
my ($class, @initializer) = @_; |
51
|
6
|
|
|
|
|
5
|
my $self = {}; |
52
|
6
|
|
33
|
|
|
26
|
bless $self, ref $class || $class || $DefaultClass; |
53
|
6
|
|
|
|
|
17
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 loadSettings() |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub loadSettings { |
61
|
4
|
|
|
4
|
1
|
22
|
my ($self, @p) = getSelf(@_); |
62
|
4
|
50
|
|
|
|
8
|
my $do = (defined $p[0]) ? $p[0] : $defaultconfig; |
63
|
4
|
100
|
|
|
|
71
|
if (-e $do) { do $do; } |
|
2
|
|
|
|
|
95
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 saveSettings() |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub saveSettings { |
71
|
2
|
|
|
2
|
1
|
28
|
my ($self, @p) = getSelf(@_); |
72
|
2
|
50
|
|
|
|
5
|
my $l = defined $p[0] ? $p[0] : $defaultconfig; |
73
|
2
|
|
|
|
|
25
|
$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
|
6
|
50
|
33
|
6
|
1
|
47
|
return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Settings'); |
|
|
|
33
|
|
|
|
|
84
|
|
|
|
|
|
|
return ( |
85
|
6
|
50
|
33
|
|
|
63
|
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; |