HTML-EP-Explorer
view release on metacpan or search on metacpan
lib/HTML/EP/Explorer/Install.pm view on Meta::CPAN
my $cfg = $HTML::EP::Explorer::Config::config;
HTML::EP::Install::InstallHtmlFiles('html', $cfg->{'html_base_dir'});
# Create an empty config.pm and make it owned by the HTTPD user.
my $config_path = File::Spec->catfile($cfg->{'html_base_dir'}, "admin",
"config.pm");
if (!-f $config_path) {
my $uid = getpwnam($cfg->{'httpd_user'});
print "Creating empty config file $config_path, owned by $uid.\n";
(open(FILE, ">>$config_path") and close(FILE))
or die "Failed to create $config_path: $!";
chown($uid, 0, $config_path)
or die "Cannot change ownership of $config_path to $uid,0: $!";
chmod(0600, $config_path)
or die "Cannot change permissions of $config_path: $!";
}
my $cache_path = File::Spec->catdir($cfg->{'html_base_dir'}, "status");
if (!-d $cache_path) {
my $uid = getpwnam($cfg->{'httpd_user'});
print "Creating empty status directory $cache_path, owned by $uid.\n";
(mkdir $cache_path, 0700)
or die "Failed to create status directory $cache_path: $!";
chown($uid, 0, $cache_path)
or die "Cannot change ownership of $cache_path to $uid,0: $!";
}
}
sub new {
my $proto = shift;
my $file = shift() || "lib/HTML/EP/Explorer/Config.pm";
my $cfg = eval {
require HTML::EP::Explorer::Config;
( run in 0.506 second using v1.01-cache-2.11-cpan-71847e10f99 )