Apache-Config-Preproc

 view release on metacpan or  search on metacpan

lib/Apache/Config/Preproc/include.pm  view on Meta::CPAN

sub server_root {
    my $self = shift;
    if (my $v = shift) {
	$self->{server_root} = $self->conf->dequote($v);
    }
    return $self->{server_root};
}

sub context_string {
    my ($self, $file) = @_;
    my ($dev,$ino) = stat($file);
    $file = abs_path($file);
    return "\"$file\" $dev $ino";
}

sub context_push {
    my ($self,$file,$dev,$ino) = @_;
    push @{$self->{context}}, { file => $file, dev => $dev, ino => $ino };
}

sub context_pop {

lib/Apache/Config/Preproc/include.pm  view on Meta::CPAN

}    

sub check_included {
    my ($self, $file) = @_;
    return $self->${ \ $self->{check_included} }($file);
}

# Default included file table for unix-like OSes
sub _check_included_stat {
    my ($self, $file) = @_;
    my ($dev,$ino) = stat($file) or return 0;
    return grep { $_->{dev} == $dev && $_->{ino} == $ino } @{$self->{context}};
}

# Path-based file table, for defective OSes (MSWin32)
sub _check_included_path {
    my ($self, $file) = @_;
    my $path = abs_path($file);
    return grep { $_->{file} eq $path } @{$self->{context}}; 
}



( run in 0.987 second using v1.01-cache-2.11-cpan-49f99fa48dc )