You are here

function drush_xmlsitemap_index in XML sitemap 7.2

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

Process un-indexed XML sitemap links.

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

File

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

Code

function drush_xmlsitemap_index() {
  $limit = (int) drush_get_option('limit', variable_get('xmlsitemap_batch_limit', XMLSITEMAP_BATCH_LIMIT));
  $count_before = db_query("SELECT COUNT(id) FROM {xmlsitemap}")
    ->fetchField();
  module_invoke_all('xmlsitemap_index_links', $limit);
  $count_after = db_query("SELECT COUNT(id) FROM {xmlsitemap}")
    ->fetchField();
  if ($count_after == $count_before) {
    drush_print(dt('No new XML sitemap links to index.'));
  }
  else {
    drush_print(dt('Indexed @count new XML sitemap links.', array(
      '@count' => $count_after - $count_before,
    )));
  }
}