/[cwmp]/google/trunk/lib/CWMP/Store/YAML.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 /google/trunk/lib/CWMP/Store/YAML.pm

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

revision 161 by dpavlin, Sat Oct 27 22:54:28 2007 UTC revision 162 by dpavlin, Sat Oct 27 22:55:45 2007 UTC
# Line 17  CWMP::Store::YAML - use YAML as storage Line 17  CWMP::Store::YAML - use YAML as storage
17    
18  =head2 open  =head2 open
19    
20      $store->open({
21            path => 'var/',
22            debug => 1,
23            clean => 1,
24      });
25    
26  =cut  =cut
27    
28  my $path;  my $path;
29    
30  my $debug = 1;  my $debug = 0;
31    
32  sub open {  sub open {
33          my $self = shift;          my $self = shift;
# Line 37  sub open { Line 43  sub open {
43    
44          if ( ! -e $path ) {          if ( ! -e $path ) {
45                  mkdir $path || die "can't create $path: $!";                  mkdir $path || die "can't create $path: $!";
46                  warn "created $path directory\n";                  warn "created $path directory\n" if $debug;
47            } elsif ( $args->{clean} ) {
48                    warn "removed old $path\n" if $debug;
49                    foreach my $uid ( $self->all_uids ) {
50                            my $file = "$path/$uid.yml";
51                            unlink $file || die "can't remove $file: $!";
52                    }
53          }          }
54    
55    
56  }  }
57    
58  =head2 update_uid_state  =head2 update_uid_state

Legend:
Removed from v.161  
changed lines
  Added in v.162

  ViewVC Help
Powered by ViewVC 1.1.26