Apache-Voodoo
view release on metacpan or search on metacpan
lib/Apache/Voodoo/Install/Config.pm view on Meta::CPAN
}
}
while (1) {
my $ans = prompt("Apache Prefix Path",$self->{PREFIX});
$ans =~ s/\/$//;
if (-e $ans && -d $ans) {
$self->{PREFIX} = $ans;
last;
}
print "That directory doesn't exist. Please try again.\n";
}
}
sub install_path {
my $self = shift;
unless ($self->{INSTALL_PATH}) {
$self->{INSTALL_PATH} = $self->{PREFIX} . "/sites";
}
$self->{INSTALL_PATH} = prompt("App Install Path",$self->{INSTALL_PATH});
$self->{INSTALL_PATH} =~ s/\/$//;
}
sub session_path {
my $self = shift;
unless ($self->{SESSION_PATH}) {
$self->{SESSION_PATH} = $self->{PREFIX} . "/session";
}
$self->{SESSION_PATH} = prompt("Session Path",$self->{SESSION_PATH});
$self->{SESSION_PATH} =~ s/\/$//;
}
sub conf_path {
my $self = shift;
unless ($self->{CONF_PATH}) {
$self->{CONF_PATH} = "etc";
}
$self->{CONF_PATH} = prompt("Config File Path (relative to App Install Path)",$self->{CONF_PATH});
$self->{CONF_PATH} =~ s/\/$//;
}
sub conf_file {
my $self = shift;
unless ($self->{CONF_FILE}) {
$self->{CONF_FILE} = "etc/voodoo.conf";
}
$self->{CONF_FILE} = prompt("Config File Name (relative to App Install Path)",$self->{CONF_FILE});
$self->{CONF_FILE} =~ s/\/$//;
}
sub updates_path {
my $self = shift;
unless ($self->{UPDATES_PATH}) {
$self->{UPDATES_PATH} = "etc/updates";
}
$self->{UPDATES_PATH} = prompt("Update File Path (relative to App Install Path)",$self->{UPDATES_PATH});
$self->{UPDATES_PATH} =~ s/\/$//;
}
sub tmpl_path {
my $self = shift;
unless ($self->{TMPL_PATH}) {
$self->{TMPL_PATH} = "html";
}
$self->{TMPL_PATH} = prompt("Template File Path (relative to App Install Path)",$self->{TMPL_PATH});
$self->{TMPL_PATH} =~ s/\/$//;
}
sub code_path {
my $self = shift;
unless ($self->{CODE_PATH}) {
$self->{CODE_PATH} = "code";
}
$self->{CODE_PATH} = prompt("Perl Module Path (relative to App Install Path)",$self->{CODE_PATH});
$self->{CODE_PATH} =~ s/\/$//;
}
sub apache_uid {
my $self = shift;
my $default = "apache";
if ($self->{'APACHE_UID'}) {
my $d = (getpwuid($self->{APACHE_UID}))[0];
$default = $d if ($d);
}
while (1) {
my $apache = prompt("User that Apache runs as",$default);
my (undef,undef,$uid,undef) = getpwnam($apache);
if ($uid =~ /^\d+$/) {
$self->{'APACHE_UID'} = $uid;
last;
}
print "Can't find this user. Please try again.\n";
}
}
sub apache_gid {
my $self = shift;
my $default = "apache";
if ($self->{'APACHE_GID'}) {
my $d = (getgrgid($self->{APACHE_GID}))[0];
$default = $d if ($d);
}
( run in 0.944 second using v1.01-cache-2.11-cpan-437f7b0c052 )