You are here

simple_sitemap.drush.inc in Simple XML sitemap 8.2

Same filename and directory in other branches
  1. 8.3 simple_sitemap.drush.inc
  2. 4.x simple_sitemap.drush.inc

Drush (< 9) integration.

File

simple_sitemap.drush.inc
View source
<?php

/**
 * @file
 * Drush (< 9) integration.
 */

/**
 * Implements hook_drush_command().
 */
function simple_sitemap_drush_command() {
  $items['simple_sitemap-generate'] = [
    'description' => 'Regenerate the XML sitemap according to the module settings.',
    'callback' => 'drush_simple_sitemap_generate',
    'drupal dependencies' => [
      'simple_sitemap',
    ],
  ];
  return $items;
}

/**
 * Callback function for hook_drush_command().
 *
 * Regenerate the XML sitemap.
 */
function drush_simple_sitemap_generate() {
  \Drupal::service('simple_sitemap.generator')
    ->generateSitemap('drush');
}

Functions

Namesort descending Description
drush_simple_sitemap_generate Callback function for hook_drush_command().
simple_sitemap_drush_command Implements hook_drush_command().