You are here

function drush_xmlsitemap_rebuild in XML sitemap 6.2

Same name and namespace in other branches
  1. 8 xmlsitemap.drush.inc \drush_xmlsitemap_rebuild()
  2. 7.2 xmlsitemap.drush.inc \drush_xmlsitemap_rebuild()

Dump and rebuild all the sitemap data, then regenerate the files.

1 string reference to 'drush_xmlsitemap_rebuild'
xmlsitemap_drush_command in ./xmlsitemap.drush.inc
Implements hook_drush_command().

File

./xmlsitemap.drush.inc, line 55
Drush integration functions for the xmlsitemap module.

Code

function drush_xmlsitemap_rebuild() {
  module_load_include('generate.inc', 'xmlsitemap');

  // Build a list of rebuildable link types.
  $rebuild_types = xmlsitemap_get_rebuildable_link_types();
  if (empty($rebuild_types)) {
    return drush_set_error(dt('No link types are rebuildable.'));
  }

  // Run the batch process.
  timer_start('xmlsitemap_rebuild');
  xmlsitemap_run_unprogressive_batch('xmlsitemap_rebuild_batch', $rebuild_types, TRUE);
  $vars = array(
    '@timer' => timer_read('xmlsitemap_rebuild'),
    '@memory-peak' => format_size(memory_get_peak_usage(TRUE)),
  );
  drush_print(dt('XML sitemap files rebuilt in @timer ms. Peak memory usage: @memory-peak.', $vars));
}