Apache-Voodoo
view release on metacpan or search on metacpan
lib/Apache/Voodoo/Debug/Native/SQLite.pm view on Meta::CPAN
sub init_db {
my $self = shift;
my $dbh = shift;
my $ac = shift;
# find the name of the connected database file
my @f = grep {$_->[1] eq "main" } @{$dbh->selectall_arrayref("pragma database_list") || $self->db_error()};
# make sure it's owned by apache
chown($ac->apache_uid,$ac->apache_gid,$f[0]->[2]);
$self->{dbh} = $dbh;
my $tables = $dbh->selectcol_arrayref("
SELECT
name
FROM
sqlite_master
WHERE
type='table' AND
lib/Apache/Voodoo/Install.pm view on Meta::CPAN
$self->info("- Checking directory $dir");
stat($dir);
if (-e _ && -d _ ) {
$self->debug(": ok");
}
else {
$pretend || mkdir($dir,770) || $self->{ignore} || die "Can't create directory $dir: $!";
$self->debug(": created");
}
$self->info("- Making sure the $dir directory is writable by apache");
$pretend || chown($uid,$gid,$dir) || $self->{ignore} || die "Can't chown directory: $!";
$pretend || chmod(0770,$dir) || $self->{ignore} || die "Can't chmod directory: $!";
$self->debug(": ok");
}
}
sub make_writeable_files {
my $self = shift;
my @files = shift;
my $pretend = $self->{'pretend'};
lib/Apache/Voodoo/Install.pm view on Meta::CPAN
foreach my $file (@files) {
$self->info("- Checking file $file");
if (-e $file) {
$self->debug(": ok");
}
else {
$pretend || (system("touch $file") && ($self->{ignore} || die "Can't create file: $!"));
$self->debug(": created");
}
$self->info("- Making sure the $file directory is writable by apache");
$pretend || chown($uid,$gid,$file) || $self->{ignore} || die "Can't chown file: $!";
$pretend || chmod(0600,$file) || $self->{ignore} || die "Can't chmod file: $!";
$self->debug(": ok");
}
}
# In a pine box somewhere De Morgan is either spinning violently, or applauding. We're not
# sure which.
1;
( run in 3.637 seconds using v1.01-cache-2.11-cpan-71847e10f99 )