Changeset 175
- Timestamp:
- 02/23/07 18:06:11 (2 years ago)
- Files:
-
- trunk/src/core/Kwiki/lib/Kwiki/Boot/V1.pm (modified) (1 diff)
- trunk/src/core/Kwiki/lib/Kwiki/Display.pm (modified) (1 diff)
- trunk/src/core/Spoon/lib/Spoon/Config.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/core/Kwiki/lib/Kwiki/Boot/V1.pm
r173 r175 16 16 $self->config->add_file('config.yaml'); 17 17 for my $filepath (glob 'config*.*') { 18 $self->config->add_ filepath($filepath);18 $self->config->add_override_filepath($filepath); 19 19 } 20 20 } trunk/src/core/Kwiki/lib/Kwiki/Display.pm
r87 r175 34 34 35 35 sub display { 36 # $self->hub->users; 37 # XXX $self->hub->config; 36 38 my $page = $self->pages->current; 37 39 return $self->redirect('') trunk/src/core/Spoon/lib/Spoon/Config.pm
r173 r175 4 4 const class_id => 'config'; 5 5 field plugin_classes => []; 6 field overrides => {}; 6 7 7 8 sub all { 8 9 return %$self; 10 } 11 12 sub add_override_filepath { 13 my $filepath = shift; 14 my $hash = $self->hash_from_file($filepath); 15 my $overrides = $self->overrides; 16 $overrides->{$_} = $hash->{$_} for keys %$hash; 17 $self->add_config($hash); 9 18 } 10 19 … … 21 30 my $filepath = shift; 22 31 my $hash = $self->hash_from_file($filepath); 23 for my $key (keys %$hash) { 24 $self->add_field($key, $hash->{$key}); 25 } 32 $self->add_config($hash); 33 $self->add_config($self->overrides); 26 34 } 27 35 28 sub add_field {29 my ($field, $value) = @_;30 field $field;31 $self->{$field} = $value;32 }36 # sub add_field { 37 # my ($field, $value) = @_; 38 # field $field; 39 # $self->{$field} = $value; 40 # } 33 41 34 42 sub add_config {
