/**
* {@inheritdoc}
*/
public function dumpPortalInformation(PortalInformation $portalInformation, $scheme)
{
if (false !== strpos($portalInformation->getUrl(), '{host}')) {
if (!$this->defaultHost) {
return;
}
$portalInformation->setUrl(str_replace('{host}', $this->defaultHost, $portalInformation->getUrl()));
}
$dumpPath = $this->getIndexDumpPath($scheme, $portalInformation->getWebspaceKey(), $portalInformation->getLocale(), $portalInformation->getHost());
$sitemap = $this->sitemapRenderer->renderIndex($portalInformation->getHost(), $scheme);
if (!$sitemap) {
$aliases = array_keys($this->sitemapProviderPool->getProviders());
$this->dumpFile($dumpPath, $this->sitemapRenderer->renderSitemap(reset($aliases), 1, $portalInformation->getLocale(), $portalInformation->getPortal(), $portalInformation->getHost(), $scheme));
return;
}
foreach ($this->sitemapProviderPool->getProviders() as $alias => $provider) {
$this->dumpProviderSitemap($alias, $portalInformation, $scheme);
}
$this->dumpFile($dumpPath, $sitemap);
}