Commit 90e680ec authored by Pawel G's avatar Pawel G

Adding drush support. It is now possible to regenerate the sitemap via...

Adding drush support. It is now possible to regenerate the sitemap via 'simplesitemap-generate' command.
parent d52c4f50
<?php
/**
* @file
* Drush integration.
*/
use Drupal\simplesitemap\Simplesitemap;
/**
* Implements hook_drush_command().
*/
function simplesitemap_drush_command() {
$items['simplesitemap-generate'] = array(
'description' => 'Regenerate XML sitemaps for all languages according to the module settings.',
'callback' => 'drush_simplesitemap_generate',
'drupal dependencies' => array('simplesitemap'),
);
return $items;
}
/**
* Callback function for hook_drush_command().
*
* Regenerate sitemap for all languages.
*/
function drush_simplesitemap_generate() {
$sitemap = new Simplesitemap;
$sitemap->generate_sitemap();
}
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