| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CGI::Application::Bouquet::Rose::Config; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
44
|
|
|
4
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
35
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
16
|
use Carp; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
87
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1208
|
use Config::IniFiles; |
|
|
2
|
|
|
|
|
54301
|
|
|
|
2
|
|
|
|
|
59
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
964
|
use Moo; |
|
|
2
|
|
|
|
|
19373
|
|
|
|
2
|
|
|
|
|
10
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
3235
|
use Types::Standard qw/Int Str/; |
|
|
2
|
|
|
|
|
135411
|
|
|
|
2
|
|
|
|
|
26
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has config => |
|
15
|
|
|
|
|
|
|
( |
|
16
|
|
|
|
|
|
|
default => sub {return ''}, |
|
17
|
|
|
|
|
|
|
is => 'rw', |
|
18
|
|
|
|
|
|
|
isa => Str, |
|
19
|
|
|
|
|
|
|
required => 0, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has section => |
|
23
|
|
|
|
|
|
|
( |
|
24
|
|
|
|
|
|
|
default => sub {return ''}, |
|
25
|
|
|
|
|
|
|
is => 'rw', |
|
26
|
|
|
|
|
|
|
isa => Str, |
|
27
|
|
|
|
|
|
|
required => 0, |
|
28
|
|
|
|
|
|
|
); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has verbose => |
|
31
|
|
|
|
|
|
|
( |
|
32
|
|
|
|
|
|
|
default => sub {return 0}, |
|
33
|
|
|
|
|
|
|
is => 'rw', |
|
34
|
|
|
|
|
|
|
isa => Int, |
|
35
|
|
|
|
|
|
|
required => 0, |
|
36
|
|
|
|
|
|
|
); |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
our $VERSION = '1.06'; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_docroot |
|
43
|
|
|
|
|
|
|
{ |
|
44
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return $$self{'config'} -> val($$self{'section'}, 'docroot'); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} # End of get_docroot. |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub get_exclude |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return $$self{'config'} -> val($$self{'section'}, 'exclude'); |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} # End of get_exclude. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub get_output_dir |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
65
|
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $$self{'config'} -> val($$self{'section'}, 'output_dir'); |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} # End of get_output_dir. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub get_tmpl_path |
|
73
|
|
|
|
|
|
|
{ |
|
74
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
75
|
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $$self{'config'} -> val($$self{'section'}, 'tmpl_path'); |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} # End of get_tmpl_path. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub get_verbose |
|
83
|
|
|
|
|
|
|
{ |
|
84
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
return $$self{'config'} -> val($$self{'section'}, 'verbose'); |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} # End of get_verbose. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub BUILD |
|
93
|
|
|
|
|
|
|
{ |
|
94
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
|
95
|
0
|
|
|
|
|
|
my($name) = '.htcgi.bouquet.conf'; |
|
96
|
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
my($path); |
|
98
|
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
for (keys %INC) |
|
100
|
|
|
|
|
|
|
{ |
|
101
|
0
|
0
|
|
|
|
|
next if ($_ !~ m|CGI/Application/Bouquet/Rose/Config.pm|); |
|
102
|
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
($path = $INC{$_}) =~ s/Config.pm/$name/; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
$self -> config(Config::IniFiles -> new(-file => $path) ); |
|
107
|
0
|
|
|
|
|
|
$self -> section('CGI::Application::Bouquet::Rose'); |
|
108
|
|
|
|
|
|
|
|
|
109
|
0
|
0
|
|
|
|
|
if (! $self -> config -> SectionExists($self -> section) ) |
|
110
|
|
|
|
|
|
|
{ |
|
111
|
0
|
|
|
|
|
|
Carp::croak "Config file '$path' does not contain the section [" . $self -> section . ']'; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
} # End of BUILD. |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# -------------------------------------------------- |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 NAME |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
C - A helper for CGI::Application::Bouquet::Rose |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 Synopsis |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
See docs for CGI::Application::Bouquet::Rose. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 Description |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
C is a pure Perl module. |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
See docs for C. |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 Constructor and initialization |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Auto-generated code will create objects of type C. You don't need to. |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 Method: get_doc_root() |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Return the value of 'doc_root' from the config file lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf. |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 Method: get_exclude() |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Return the value of 'exclude' from the config file lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf. |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 Method: get_output_dir() |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Return the value of 'output_dir' from the config file lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf. |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 Method: get_tmpl_path() |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Return the value of 'tmpl_path' from the config file lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf. |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 Method: get_verbose() |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Return the value of 'verbose' from the config file lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf. |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 Author |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
C was written by Ron Savage Iron@savage.net.auE> in 2008. |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Home page: http://savage.net.au/index.html |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 Copyright |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Australian copyright (c) 2008, Ron Savage. |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
All Programs of mine are 'OSI Certified Open Source Software'; |
|
169
|
|
|
|
|
|
|
you can redistribute them and/or modify them under the terms of |
|
170
|
|
|
|
|
|
|
The Artistic License, a copy of which is available at: |
|
171
|
|
|
|
|
|
|
http://www.opensource.org/licenses/index.html |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=cut |