| 1 | package Apache::SiteConfig::Template; | ||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use Apache::SiteConfig; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Apache::SiteConfig::Root; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | 0 | ▶ | sub new_context { | ||||||||
|
Subroutine
new_context: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | 0 | return Apache::SiteConfig::Root->new; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub build { | ||||||||
|
Subroutine
build: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 14 | 0 | my ($self,%args) = @_; | |||||||||
| 15 | |||||||||||
| 16 | 0 | my $args = \%args; | |||||||||
| 17 | 0 | my $root = $self->new_context; | |||||||||
| 18 | 0 | my $vir = $root->add_section( 'VirtualHost' , '*:80' ); | |||||||||
| 19 | |||||||||||
| 20 | 0 | for( grep { $args->{$_} } qw(ServerName ServerAlias DocumentRoot)) { | |||||||||
| 21 | 0 | $vir->add_directive( $_ , $args{$_} ); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | my $root_dir = $vir->add_section('Directory' , '/'); | |||||||||
| 25 | 0 | $root_dir->add_directive( 'Options' , 'FollowSymLinks' ); | |||||||||
| 26 | 0 | $root_dir->add_directive( 'AllowOverride' , 'None' ); | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $doc_root = $vir->add_section('Directory', $args{DocumentRoot} ); | |||||||||
| 29 | 0 | $doc_root->add_directive( 'Options' , 'Indexes FollowSymLinks MultiViews' ); | |||||||||
| 30 | 0 | $doc_root->add_directive( 'AllowOverride' , 'None' ); | |||||||||
| 31 | 0 | $doc_root->add_directive( 'Order' , 'allow,deny' ); | |||||||||
| 32 | 0 | $doc_root->add_directive( 'Allow' , 'from all' ); | |||||||||
| 33 | |||||||||||
| 34 | 0 | $vir->add_directive( 'LogLevel' , 'info' ); | |||||||||
| 35 | 0 | ▶ | $vir->add_directive( 'CustomLog' , [ $args{CustomLog} , 'combine' ] ) if $args{CustomLog}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | ▶ | $vir->add_directive( 'ErrorLog' , $args{ErrorLog} ) if $args{ErrorLog}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | return $root; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 2 | 1; | |||||||||
| 41 | __END__ | ||||||||||