Ignore:
Timestamp:
2008-05-27T15:02:16+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Added $infodb_type as first argument to all the dbutil functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/dbutil.pm

    r15722 r15725  
    3131sub get_infodb_file_path
    3232{
     33    my $infodb_type = shift(@_);
    3334    my $collection_name = shift(@_);
    3435    my $infodb_directory_path = shift(@_);
    3536
     37    if ($infodb_type eq "sqlite")
     38    {
     39    return &get_infodb_file_path_sqlite($collection_name, $infodb_directory_path);
     40    }
     41
     42    # Use GDBM if the infodb type is empty or not one of the values above
    3643    return &get_infodb_file_path_gdbm($collection_name, $infodb_directory_path);
    3744}
     
    4047sub open_infodb_write_handle
    4148{
    42     my $infodb_file_path = shift(@_);
    43 
     49    my $infodb_type = shift(@_);
     50    my $infodb_file_path = shift(@_);
     51
     52    if ($infodb_type eq "sqlite")
     53    {
     54    return &open_infodb_write_handle_sqlite($infodb_file_path);
     55    }
     56
     57    # Use GDBM if the infodb type is empty or not one of the values above
    4458    return &open_infodb_write_handle_gdbm($infodb_file_path);
    4559}
     
    4862sub read_infodb_file
    4963{
     64    my $infodb_type = shift(@_);
    5065    my $infodb_file_path = shift(@_);
    5166    my $infodb_map = shift(@_);
     
    5772sub write_infodb_entry
    5873{
     74    my $infodb_type = shift(@_);
    5975    my $infodb_handle = shift(@_);
    6076    my $infodb_key = shift(@_);
    6177    my $infodb_map = shift(@_);
    6278
    63     &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map);
     79    if ($infodb_type eq "sqlite")
     80    {
     81    return &write_infodb_entry_sqlite($infodb_handle, $infodb_key, $infodb_map);
     82    }
     83
     84    # Use GDBM if the infodb type is empty or not one of the values above
     85    return &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map);
    6486}
    6587
Note: See TracChangeset for help on using the changeset viewer.