Advanced-Config

 view release on metacpan or  search on metacpan

Config.pm  view on Meta::CPAN

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
   $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!";

Config.pm  view on Meta::CPAN

896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
   } 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 0.603 second using v1.01-cache-2.11-cpan-49f99fa48dc )