/[webpac2]/trunk/lib/WebPAC/DB.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/WebPAC/DB.pm

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

revision 21 by dpavlin, Sun Jul 17 15:04:39 2005 UTC revision 22 by dpavlin, Sun Jul 17 22:48:25 2005 UTC
# Line 102  sub path { Line 102  sub path {
102          }          }
103  }  }
104    
105  =head2 load_gs  =head2 load_ds
106    
107  Retrive from disk one data_structure records using field 000 as key  Retrive from disk one data_structure records using field 000 as key
108    
109    my @ds = $db->load_gs($rec);    my @ds = $db->load_ds($rec);
110    
111  This function will also perform basic sanity checking on returned  This function will also perform basic sanity checking on returned
112  data and disable caching if data is corrupted (or changed since last  data and disable caching if data is corrupted (or changed since last
# Line 116  Returns array or undef if cacheing is di Line 116  Returns array or undef if cacheing is di
116    
117  =cut  =cut
118    
119  sub load_gs {  sub load_ds {
120          my $self = shift;          my $self = shift;
121    
122          return unless $self->{'path'};          return unless $self->{'path'};
# Line 161  sub load_gs { Line 161  sub load_gs {
161          return undef;          return undef;
162  }  }
163    
164  =head2 save_gs  =head2 save_ds
165    
166  Store data_structure on disk.  Store data_structure on disk.
167    
168    $db->save_gs(    $db->save_ds(
169          ds => \@ds,          ds => \@ds,
170          current_filename => $self->{'current_filename'},          current_filename => $self->{'current_filename'},
171          headline => $self->{'headline'},          headline => $self->{'headline'},
# Line 173  Store data_structure on disk. Line 173  Store data_structure on disk.
173    
174  B<Totally broken, but fast.>  B<Totally broken, but fast.>
175    
176  Depends on filename generated by C<load_gs>.  Depends on filename generated by C<load_ds>.
177    
178  =cut  =cut
179    
180  sub save_gs {  sub save_ds {
181          my $self = shift;          my $self = shift;
182    
183          return unless($self->{'path'});          return unless($self->{'path'});
# Line 187  sub save_gs { Line 187  sub save_gs {
187    
188          my $log = $self->_get_logger;          my $log = $self->_get_logger;
189    
190          $log->logdie("save_gs without cache_file -- did you called gs_get before?") unless ($self->{'cache_file'});          $log->logdie("save_ds without cache_file -- did you called gs_get before?") unless ($self->{'cache_file'});
191    
192          foreach my $e (qw/ds current_filename headline/) {          foreach my $e (qw/ds current_filename headline/) {
193                  $log->logdie("missing $e") unless $arg->{$e};                  $log->logdie("missing $e") unless $arg->{$e};

Legend:
Removed from v.21  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26