Commit aeefdd47 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Added output to the xmlsitemap-index drush command.

parent f6577daf
......@@ -102,5 +102,15 @@ function drush_xmlsitemap_rebuild() {
*/
function drush_xmlsitemap_index() {
$limit = (int) drush_get_option('limit', variable_get('xmlsitemap_batch_limit', 100));
$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)));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment