line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package ASP4::ConfigNode::System; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
39
|
use strict; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
306
|
|
5
|
9
|
|
|
9
|
|
39
|
use warnings 'all'; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
402
|
|
6
|
9
|
|
|
9
|
|
41
|
use base 'ASP4::ConfigNode'; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
2456
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
9
|
|
|
9
|
0
|
17
|
my $class = shift; |
12
|
|
|
|
|
|
|
|
13
|
9
|
|
|
|
|
68
|
my $s = $class->SUPER::new( @_ ); |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
|
|
29
|
return $s; |
16
|
|
|
|
|
|
|
}# end new() |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub libs |
20
|
|
|
|
|
|
|
{ |
21
|
5131
|
|
|
5131
|
1
|
3755
|
my $s = shift; |
22
|
|
|
|
|
|
|
|
23
|
5131
|
50
|
|
|
|
3271
|
@{ $s->{libs} || [ ] }; |
|
5131
|
|
|
|
|
20027
|
|
24
|
|
|
|
|
|
|
}# end libs() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub load_modules |
28
|
|
|
|
|
|
|
{ |
29
|
9
|
|
|
9
|
1
|
16
|
my $s = shift; |
30
|
|
|
|
|
|
|
|
31
|
9
|
50
|
|
|
|
12
|
@{ $s->{load_modules} || [ ] }; |
|
9
|
|
|
|
|
49
|
|
32
|
|
|
|
|
|
|
}# end load_modules() |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub env_vars |
36
|
|
|
|
|
|
|
{ |
37
|
10
|
|
|
10
|
1
|
17
|
my $s = shift; |
38
|
|
|
|
|
|
|
|
39
|
10
|
50
|
|
|
|
153
|
$s->{env_vars} || { }; |
40
|
|
|
|
|
|
|
}# end env_vars() |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub post_processors |
44
|
|
|
|
|
|
|
{ |
45
|
9
|
|
|
9
|
1
|
21
|
my $s = shift; |
46
|
|
|
|
|
|
|
|
47
|
9
|
50
|
|
|
|
18
|
@{ $s->{post_processors} || [ ] }; |
|
9
|
|
|
|
|
70
|
|
48
|
|
|
|
|
|
|
}# end post_processors() |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub settings |
52
|
|
|
|
|
|
|
{ |
53
|
1
|
|
|
1
|
1
|
1
|
my $s = shift; |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
50
|
|
|
12
|
return $s->{settings} || { }; |
56
|
|
|
|
|
|
|
}# end settings() |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1;# return true: |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
ASP4::ConfigNode::System - the 'system' portion of the config. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $system = $Config->system; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This package provides special access to the elements specific to the C |
73
|
|
|
|
|
|
|
portion of the XML config file. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 PUBLIC PROPERTIES |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 libs |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
A list of library paths that should be included into C<@INC>. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 load_modules |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
A list of Perl modules that should be loaded automatically. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 post_processors |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
A list of L modules that should be given the ability to alter the config before |
88
|
|
|
|
|
|
|
it is considered "ready for use" by the rest of the application. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 env_vars |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
A hash of C<%ENV> variables that should be set. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 settings |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
A collection of special read-only values that should be available throughout the application. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Examples include encryption keys, API keys and username/password combos to access remote services. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 BUGS
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
It's possible that some bugs have found their way into this release.
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Use RT L to submit bug reports.
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 HOMEPAGE
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Please visit the ASP4 homepage at L to see examples
|
109
|
|
|
|
|
|
|
of ASP4 in action.
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 AUTHOR
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
John Drago
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Copyright 2007 John Drago, All rights reserved.
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This software is free software. It may be used and distributed under the
|
120
|
|
|
|
|
|
|
same terms as Perl itself.
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|