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

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

revision 715 by dpavlin, Tue Sep 26 14:03:12 2006 UTC revision 734 by dpavlin, Sun Oct 1 20:14:14 2006 UTC
# Line 14  WebPAC::Store - Store WebPAC data on dis Line 14  WebPAC::Store - Store WebPAC data on dis
14    
15  =head1 VERSION  =head1 VERSION
16    
17  Version 0.12  Version 0.13
18    
19  =cut  =cut
20    
21  our $VERSION = '0.12';  our $VERSION = '0.13';
22    
23  =head1 SYNOPSIS  =head1 SYNOPSIS
24    
# Line 180  sub load_ds { Line 180  sub load_ds {
180    
181          my $input = $args->{input} || '';          my $input = $args->{input} || '';
182    
183          my $cache_file = "$cache_path/$database/$input/$id";          my $cache_file = "$cache_path/ds/$database/$input/$id";
184          $cache_file =~ s#//#/#go;          $cache_file =~ s#//#/#go;
185    
186          $log->debug("using cache_file $cache_file");          $log->debug("using cache_file $cache_file");
# Line 215  Store data_structure on disk. Line 215  Store data_structure on disk.
215          ds => $ds,          ds => $ds,
216    );    );
217    
218  B<Totally broken, but fast.>  C<database> and C<input> are optional.
   
 Depends on filename generated by C<load_ds>.  
219    
220  =cut  =cut
221    
# Line 242  sub save_ds { Line 240  sub save_ds {
240    
241          my $input = $args->{input} || '';          my $input = $args->{input} || '';
242    
243          my $cache_file = $self->{path} . "/$database/$input/";          my $cache_file = $self->{path} . "/ds/$database/$input/";
244          $cache_file =~ s#//#/#go;          $cache_file =~ s#//#/#go;
245    
246          mkpath($cache_file) unless (-d $cache_file);          mkpath($cache_file) unless (-d $cache_file);
# Line 260  sub save_ds { Line 258  sub save_ds {
258    
259  =head2 load_lookup  =head2 load_lookup
260    
261    Loads lookup hash from file
262    
263    $data = $db->load_lookup(    $data = $db->load_lookup(
264          database => $database,          database => $database,
265          input => $input,          input => $input,
266          key => $key,          key => $key,
267    );    );
268    
269    C<database> is optional.
270    
271  =cut  =cut
272    
273  sub load_lookup {  sub load_lookup {
# Line 298  sub load_lookup { Line 300  sub load_lookup {
300    
301  =head2 save_lookup  =head2 save_lookup
302    
303    Save lookup data to file.
304    
305    $db->save_lookup(    $db->save_lookup(
306          database => $database,          database => $database,
307          input => $input,          input => $input,
# Line 305  sub load_lookup { Line 309  sub load_lookup {
309          data => $lookup,          data => $lookup,
310    );    );
311    
312    C<database> is optional.
313    
314  =cut  =cut
315    
316  sub save_lookup {  sub save_lookup {
# Line 341  Dobrica Pavlinusic, C<< <dpavlin@rot13.o Line 347  Dobrica Pavlinusic, C<< <dpavlin@rot13.o
347    
348  =head1 COPYRIGHT & LICENSE  =head1 COPYRIGHT & LICENSE
349    
350  Copyright 2005 Dobrica Pavlinusic, All Rights Reserved.  Copyright 2005-2006 Dobrica Pavlinusic, All Rights Reserved.
351    
352  This program is free software; you can redistribute it and/or modify it  This program is free software; you can redistribute it and/or modify it
353  under the same terms as Perl itself.  under the same terms as Perl itself.

Legend:
Removed from v.715  
changed lines
  Added in v.734

  ViewVC Help
Powered by ViewVC 1.1.26