Apache-Voodoo

 view release on metacpan or  search on metacpan

lib/Apache/Voodoo/Install/Config.pm  view on Meta::CPAN

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);
	}

	while (1) {
		my $apache = prompt("Group that Apache runs as",$default);
		my (undef,undef,undef,$gid) = getpwnam($apache);
		if ($gid =~ /^\d+$/) {
			$self->{'APACHE_GID'} = $gid;
			last;
		}
		print "Can't find this group.  Please try again.\n";
	}
}

sub debug_dbd {
	my $self = shift;

	unless ($self->{DEBUG_DBD}) {
		$self->{DEBUG_DBD} = ['dbi:SQLite:dbname=/tmp/apachevoodoo.db','',''];
	}

	$self->{DEBUG_DBD}->[0] = prompt("Debug Database Connect", $self->{DEBUG_DBD}->[0]);
	$self->{DEBUG_DBD}->[1] = prompt("Debug Database Username",$self->{DEBUG_DBD}->[1]);
	$self->{DEBUG_DBD}->[2] = prompt("Debug Database Password",$self->{DEBUG_DBD}->[2]);
}

sub debug_path {
	my $self = shift;

	unless ($self->{DEBUG_PATH}) {
		$self->{DEBUG_PATH} = "/debug";
	}

	$self->{DEBUG_PATH} = prompt("URL Path to the debug handler",$self->{DEBUG_PATH});
}

1;

################################################################################
# Copyright (c) 2005-2010 Steven Edwards (maverick@smurfbane.org).



( run in 2.532 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )