/[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 233 by dpavlin, Tue Dec 6 16:40:18 2005 UTC revision 236 by dpavlin, Tue Dec 6 23:48:11 2005 UTC
# Line 14  WebPAC::Store - Store normalized data on Line 14  WebPAC::Store - Store normalized data on
14    
15  =head1 VERSION  =head1 VERSION
16    
17  Version 0.07  Version 0.08
18    
19  =cut  =cut
20    
21  our $VERSION = '0.07';  our $VERSION = '0.08';
22    
23  =head1 SYNOPSIS  =head1 SYNOPSIS
24    
# Line 128  sub path { Line 128  sub path {
128    
129  Retrive from disk one data_structure records usually using field 000 as key  Retrive from disk one data_structure records usually using field 000 as key
130    
131    my $ds = $db->load_ds( id => 42, prefix => 'name' );    my $ds = $db->load_ds( id => 42, prefix => 'name', database => 'ps' );
132    
133  This function will also perform basic sanity checking on returned  This function will also perform basic sanity checking on returned
134  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 137  update). Line 137  update).
137  C<prefix> is used to differenciate different source input databases  C<prefix> is used to differenciate different source input databases
138  which are indexed in same database.  which are indexed in same database.
139    
140    C<database> if B<optional> argument which will override database name used when creating
141    C<WebPAC::Store> object (for simple retrival from multiple databases).
142    
143  Returns hash or undef if cacheing is disabled or unavailable.  Returns hash or undef if cacheing is disabled or unavailable.
144    
145  =cut  =cut
# Line 161  sub load_ds { Line 164  sub load_ds {
164          $log->logconfess("got hash, but without id") unless (defined($id));          $log->logconfess("got hash, but without id") unless (defined($id));
165          $log->logconfess("got hash, but id [$id] isn't number") unless ($id =~ /^\d+$/);          $log->logconfess("got hash, but id [$id] isn't number") unless ($id =~ /^\d+$/);
166    
167          my $database = $self->{database};          my $database = $args->{database} || $self->{database};
168          my $prefix = $args->{prefix} || '';          my $prefix = $args->{prefix} || '';
169    
170          $log->logconfess("can't find database name") unless ($database);          $log->logconfess("can't find database name") unless ($database);

Legend:
Removed from v.233  
changed lines
  Added in v.236

  ViewVC Help
Powered by ViewVC 1.1.26