line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Apache::SiteConfig::Root; |
2
|
1
|
|
|
1
|
|
319
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use Apache::SiteConfig::Section; |
4
|
|
|
|
|
|
|
use Apache::SiteConfig::Directive; |
5
|
|
|
|
|
|
|
extends 'Apache::SiteConfig::Statement'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has statements => ( is => 'rw' , isa => 'ArrayRef' , default => sub { [ ] } ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub add_directive { |
10
|
|
|
|
|
|
|
my ($self,$name,$values) = @_; |
11
|
|
|
|
|
|
|
$values = ref($values) ? $values : [ $values ]; |
12
|
|
|
|
|
|
|
my $dt = Apache::SiteConfig::Directive->new( |
13
|
|
|
|
|
|
|
name => $name, |
14
|
|
|
|
|
|
|
values => $values, |
15
|
|
|
|
|
|
|
parent => $self, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
push @{$self->statements} , $dt; |
18
|
|
|
|
|
|
|
return $dt; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_section { |
22
|
|
|
|
|
|
|
my ($self,$name,$value) = @_; |
23
|
|
|
|
|
|
|
my $section = Apache::SiteConfig::Section->new( |
24
|
|
|
|
|
|
|
name => $name, |
25
|
|
|
|
|
|
|
value => $value, |
26
|
|
|
|
|
|
|
parent => $self, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
push @{$self->statements} , $section; |
29
|
|
|
|
|
|
|
return $section; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub to_string { |
33
|
|
|
|
|
|
|
my ($self) = @_; |
34
|
|
|
|
|
|
|
return join "\n", |
35
|
|
|
|
|
|
|
(map { $_->to_string } @{ $self->statements }); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |