File Coverage

blib/lib/Apache/Voodoo/Install/Post.pm
Criterion Covered Total %
statement 15 37 40.5
branch 0 2 0.0
condition n/a
subroutine 5 7 71.4
pod 0 2 0.0
total 20 48 41.6


line stmt bran cond sub pod time code
1             ################################################################################
2             #
3             # Apache::Voodoo::Install::Post
4             #
5             # Handles common post site setup tasks. This object is used by Voodoo internally.
6             #
7             ################################################################################
8             package Apache::Voodoo::Install::Post;
9              
10             $VERSION = "3.0200";
11              
12 1     1   1701 use strict;
  1         3  
  1         35  
13 1     1   5 use warnings;
  1         2  
  1         25  
14              
15 1     1   5 use base("Apache::Voodoo::Install");
  1         3  
  1         76  
16              
17 1     1   9 use Apache::Voodoo::Constants;
  1         5  
  1         21  
18              
19 1     1   5 use Config::General qw(ParseConfig);
  1         2  
  1         337  
20              
21             sub new {
22 0     0 0   my $class = shift;
23 0           my %params = @_;
24              
25 0           my $self = {%params};
26              
27 0           my $ac = Apache::Voodoo::Constants->new();
28 0           $self->{'_md5_'} = Digest::MD5->new;
29              
30 0           $self->{'prefix'} = $ac->prefix();
31 0           $self->{'install_path'} = $ac->install_path()."/".$self->{'app_name'};
32              
33 0           $self->{'conf_file'} = $self->{'install_path'}."/".$ac->conf_file();
34 0           $self->{'apache_uid'} = $ac->apache_uid();
35 0           $self->{'apache_gid'} = $ac->apache_gid();
36              
37 0 0         unless (-e $self->{'conf_file'}) {
38 0           die "Can't open configuration file: $self->{'conf_file'}\n";
39             }
40              
41 0           $self->{'conf_data'} = { ParseConfig($self->{'conf_file'}) };
42              
43 0           bless $self, $class;
44 0           return $self;
45             }
46              
47             sub do_setup_checks {
48 0     0 0   my $self = shift;
49              
50 0           my $install_path = $self->{'install_path'};
51 0           my $prefix = $self->{'prefix'};
52 0           my $app_name = $self->{'app_name'};
53              
54 0           $self->make_symlink("$install_path/code","$prefix/lib/perl/$app_name");
55              
56 0           $self->info("- Checking session directory:");
57 0           $self->make_writeable_dirs($self->{'conf_data'}->{'session_dir'});
58             }
59              
60             1;
61              
62             ################################################################################
63             # Copyright (c) 2005-2010 Steven Edwards (maverick@smurfbane.org).
64             # All rights reserved.
65             #
66             # You may use and distribute Apache::Voodoo under the terms described in the
67             # LICENSE file include in this package. The summary is it's a legalese version
68             # of the Artistic License :)
69             #
70             ################################################################################