/[Frey]/trunk/lib/Frey/Config.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Config.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 229 by dpavlin, Sat Nov 1 13:17:45 2008 UTC revision 342 by dpavlin, Sun Nov 9 10:54:30 2008 UTC
# Line 33  configuration. Line 33  configuration.
33    
34  our %config;  our %config;
35    
36    sub debug { 1 };
37    
38  sub load_config {  sub load_config {
39          my $self = shift;          my $self = shift;
40          foreach my $name ( 'config', 'site_config', ref($self), @_ ) {          foreach my $name ( 'config', 'site_config', ref($self), @_ ) {
# Line 43  sub load_config { Line 45  sub load_config {
45                  } else {                  } else {
46                          %config = %{ merge( LoadFile($path) , \%config ) } if -e $path;                          %config = %{ merge( LoadFile($path) , \%config ) } if -e $path;
47                  }                  }
48                  warn "## $path current config = ",dump( %config ) if $self->debug;                  warn "## load_config $path current config = ",dump( %config ) if $self->debug;
49          }          }
50  }  }
51    
52  sub config {  sub config {
53          my $self = shift;          my ( $self, $key ) = @_;
54          my $key = shift || ref($self);          $key ||= ref($self);
55          warn "## config $key" if $self->debug;          warn "## config $key" if $self->debug;
56          $self->load_config unless defined %config;          $self->load_config unless defined %config;
57          #confess "$key doesn't exist in config" unless defined $config{ $key };          #confess "$key doesn't exist in config" unless defined $config{ $key };

Legend:
Removed from v.229  
changed lines
  Added in v.342

  ViewVC Help
Powered by ViewVC 1.1.26