Changeset 21547

Show
Ignore:
Timestamp:
20.01.2010 17:23:51 (9 years ago)
Author:
mdewsnip
Message:

Changed dbutil.pm to add a new read_infodb_entry() function. This currently has a temporary very slow and naive implementation that just reads the entire file and picks out the one requested value. This will soon be replaced with database-specific versions that will use dbget etc.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/dbutil.pm

    r21546 r21547  
    178178 
    179179 
     180sub read_infodb_entry 
     181{ 
     182  my $infodb_type = shift(@_); 
     183  my $infodb_file_path = shift(@_); 
     184  my $infodb_key = shift(@_); 
     185 
     186  # !! TEMPORARY: Slow and naive implementation that just reads the entire file and picks out the one value 
     187  # !! This will soon be replaced with database-specific versions that will use dbget etc. 
     188  my $infodb_map = {}; 
     189  &read_infodb_file($infodb_type, $infodb_file_path, $infodb_map); 
     190  return $infodb_map->{$infodb_key}; 
     191} 
     192 
     193 
    180194sub write_infodb_entry 
    181195{