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 |
|
|
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 |
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 |
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); |