geocoder.install 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the Geocoder module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function geocoder_schema() {
  10. $schema['cache_geocoder'] = drupal_get_schema_unprocessed('system', 'cache');
  11. $schema['cache_geocoder']['description'] = 'Cache table for the geocoder module to store geocoded locations.';
  12. return $schema;
  13. }
  14. /**
  15. * Implements hook_uninstall().
  16. */
  17. function geocoder_uninstall() {
  18. variable_del('geocoder_settings');
  19. variable_del('geocoder_cache_empty_results');
  20. variable_del('geocoder_cache_ttl');
  21. }
  22. /**
  23. * Create geocoder's caching table.
  24. */
  25. function geocoder_update_7101() {
  26. // Avoid installing the table twice.
  27. if (db_table_exists('cache_geocoder')) {
  28. return;
  29. }
  30. $schema['cache_geocoder'] = drupal_get_schema_unprocessed('system', 'cache');
  31. $schema['cache_geocoder']['description'] = 'Cache table for the geocoder module to store geocoded locations.';
  32. db_create_table('cache_geocoder', $schema['cache_geocoder']);
  33. }