You are here

public function XmlSitemapGenerator::regenerateBefore in XML sitemap 8

Same name and namespace in other branches
  1. 2.x src/XmlSitemapGenerator.php \Drupal\xmlsitemap\XmlSitemapGenerator::regenerateBefore()

Perform operations before rebuilding the sitemap.

Overrides XmlSitemapGeneratorInterface::regenerateBefore

File

src/XmlSitemapGenerator.php, line 192

Class

XmlSitemapGenerator
XmlSitemap generator service class.

Namespace

Drupal\xmlsitemap

Code

public function regenerateBefore() {

  // Attempt to increase the memory limit.
  $this
    ->setMemoryLimit();
  if ($this->state
    ->get('xmlsitemap_developer_mode')) {
    $this->logger
      ->notice('Starting XML sitemap generation. Memory usage: @memory-peak.', [
      '@memory-peak' => format_size(memory_get_peak_usage(TRUE)),
    ]);
  }
}