Changeset 17104
- Timestamp:
- 2008-08-29T15:07:49+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/dbutil.pm
r17087 r17104 34 34 my $infodb_file_path = shift(@_); 35 35 36 if ($infodb_type eq "sqlite") { 36 if ($infodb_type eq "sqlite") 37 { 37 38 return &open_infodb_write_handle_sqlite($infodb_file_path); 38 39 } 39 elsif ($infodb_type eq "gdbm") { 40 elsif ($infodb_type eq "gdbm") 41 { 40 42 return &open_infodb_write_handle_gdbm($infodb_file_path); 41 43 } 42 44 43 # Use text (gzipped) version ready for conver tion to GDBM45 # Use text (gzipped) version ready for conversion to GDBM 44 46 # if the infodb type is empty or not one of the values above 45 47 return &open_infodb_write_handle_gdbm_txtgz($infodb_file_path); … … 52 54 my $infodb_handle = shift(@_); 53 55 54 if ($infodb_type eq "sqlite") { 56 if ($infodb_type eq "sqlite") 57 { 55 58 return &close_infodb_write_handle_sqlite($infodb_handle); 56 59 } 57 elsif ($infodb_type eq "gdbm") { 60 elsif ($infodb_type eq "gdbm") 61 { 58 62 return &close_infodb_write_handle_gdbm($infodb_handle); 59 63 } 60 64 61 # Use text (gzipped) version ready for conver tion to GDBM65 # Use text (gzipped) version ready for conversion to GDBM 62 66 # if the infodb type is empty or not one of the values above return 63 64 &close_infodb_write_handle_gdbm_txtgz($infodb_handle);}67 &close_infodb_write_handle_gdbm_txtgz($infodb_handle); 68 } 65 69 66 70 … … 81 85 return &get_infodb_file_path_sqlite($collection_name, $infodb_directory_path); 82 86 } 83 elsif ($infodb_type eq "gdbm") { 87 elsif ($infodb_type eq "gdbm") 88 { 84 89 return &get_infodb_file_path_gdbm($collection_name, $infodb_directory_path); 85 90 } 86 91 87 # Use text (gzipped) version ready for conver tion to GDBM92 # Use text (gzipped) version ready for conversion to GDBM 88 93 # if the infodb type is empty or not one of the values above return 89 90 94 return &get_infodb_file_path_gdbm_txtgz($collection_name, $infodb_directory_path); 91 95 } 92 96 93 97 94 95 96 98 sub read_infodb_file 97 99 { … … 104 106 return &read_infodb_file_sqlite($infodb_file_path, $infodb_map); 105 107 } 106 elsif ($infodb_type eq "gdbm") { 108 elsif ($infodb_type eq "gdbm") 109 { 107 110 return &read_infodb_file_gdbm($infodb_file_path, $infodb_map); 108 111 } 109 112 110 # Use text (gzipped) version ready for conver tion to GDBM113 # Use text (gzipped) version ready for conversion to GDBM 111 114 # if the infodb type is empty or not one of the values above return 112 113 115 return &read_infodb_file_gdbm_txtgz($infodb_file_path, $infodb_map); 114 116 } … … 126 128 return &write_infodb_entry_sqlite($infodb_handle, $infodb_key, $infodb_map); 127 129 } 128 elsif ($infodb_type eq "gdbm") { 130 elsif ($infodb_type eq "gdbm") 131 { 129 132 return &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map); 130 133 } 131 134 132 # Use text (gzipped) version ready for conver tion to GDBM135 # Use text (gzipped) version ready for conversion to GDBM 133 136 # if the infodb type is empty or not one of the values above return 134 137 return &write_infodb_entry_gdbm_txtgz($infodb_handle, $infodb_key, $infodb_map); … … 165 168 } 166 169 170 167 171 sub close_infodb_write_handle_gdbm_txtgz 168 172 { … … 281 285 282 286 283 284 285 287 sub read_infodb_file_gdbm 286 288 { … … 350 352 351 353 352 353 354 sub close_infodb_write_handle_sqlite 354 355 { … … 374 375 return &util::filename_cat($infodb_directory_path, $infodb_file_name); 375 376 } 376 377 377 378 378
Note:
See TracChangeset
for help on using the changeset viewer.