xmlsitemap_engines.install 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the xmlsitemap_engines module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function xmlsitemap_engines_install() {
  10. // Set this module's weight to 1 so xmlsitemap_engines_cron() runs after
  11. // the sitemap has been generated in xmlsitemap_cron().
  12. db_update('system')
  13. ->fields(array('weight' => 2))
  14. ->condition('type', 'module')
  15. ->condition('name', 'xmlsitemap_engines')
  16. ->execute();
  17. }
  18. /**
  19. * Implements hook_uninstall().
  20. */
  21. function xmlsitemap_engines_uninstall() {
  22. variable_del('xmlsitemap_engines_engines');
  23. variable_del('xmlsitemap_engines_custom_urls');
  24. variable_del('xmlsitemap_engines_minimum_lifetime');
  25. variable_del('xmlsitemap_engines_submit_last');
  26. variable_del('xmlsitemap_engines_submit_updated');
  27. }
  28. /**
  29. * Deprecate support for Ask.com, Moreover, and Yahoo! search engines.
  30. */
  31. function xmlsitemap_engines_update_6202() {
  32. $engines = variable_get('xmlsitemap_engines_engines', array());
  33. $removed = array(
  34. 'ask' => 'Ask.com',
  35. 'moreover' => 'Moreover',
  36. 'yahoo' => 'Yahoo.com',
  37. );
  38. $engines = array_diff($engines, array_keys($removed));
  39. variable_set('xmlsitemap_engines_engines', $engines);
  40. return t('The following search engines have deprecated their XML sitemap ping services and have been disabled: !list.', array('!list' => implode(', ', $removed)));
  41. }