Advanced-Config
view release on metacpan or search on metacpan
$self->_wipe_internal_data ( $filename );
}
# Auto add the alias if it's a symbolic link & there isn't an alias.
# Otherwise decryption won't work!
if ( -l $filename && ! $read_opts->{alias} ) {
$read_opts->{alias} = abs_path( $filename );
}
# So refresh logic will work ...
$self->{CONTROL}->{REFRESH_MODIFY_TIME}->{$filename} = (stat( $filename ))[9];
$self->{CONTROL}->{REFRESH_READ_OPTIONS}->{$filename} = get_read_opts ($read_opts);
# So will auto-clear if die is called!
local $self->{CONTROL}->{RECURSION}->{$filename} = 1;
# Temp override of the default read options ...
local $self->{CONTROL}->{read_opts} = $read_opts;
unless ( read_config ( $filename, $self ) ) {
my $msg = "Reading the config file had serious issues!";
} else {
$dates{timestamp} = $self->{CONTROL}->{DATES}->{timestamp};
}
}
# Try to detect if any config files were modified ...
unless ( $updated ) {
DBUG_PRINT ("INFO", "Checking the file timestamps ...");
foreach my $f ( sort keys %{$self->{CONTROL}->{REFRESH_MODIFY_TIME}} ) {
# Can't do ref($f) since key is stored as a string here.
my $modify_time = ( $f =~ m/^SCALAR[(]0x[0-9a-f]+[)]$/ ) ? 0 : (stat( $f ))[9];
if ( $modify_time > $self->{CONTROL}->{REFRESH_MODIFY_TIME}->{$f} ) {
DBUG_PRINT ("WARN", "File was modified: %s", $f);
$updated = 1;
last;
}
}
}
# Refresh the config file's contents in memory ...
( run in 1.054 second using v1.01-cache-2.11-cpan-49f99fa48dc )