Пример #1
0
 /**
  * Render sitemap for provider.
  *
  * @param string $alias
  * @param PortalInformation $portalInformation
  * @param string $scheme
  */
 private function dumpProviderSitemap($alias, PortalInformation $portalInformation, $scheme)
 {
     $maxPage = $this->sitemapProviderPool->getProvider($alias)->getMaxPage();
     for ($page = 1; $page <= $maxPage; ++$page) {
         $sitemap = $this->sitemapRenderer->renderSitemap($alias, $page, $portalInformation->getLocale(), $portalInformation->getPortal(), $portalInformation->getHost(), $scheme);
         $this->dumpFile($this->getDumpPath($scheme, $portalInformation->getWebspaceKey(), $portalInformation->getLocale(), $portalInformation->getHost(), $alias, $page), $sitemap);
     }
 }
Пример #2
0
 /**
  * Returns true if a index exists.
  *
  * @return bool
  */
 private function needsIndex()
 {
     return 1 < count($this->sitemapProviderPool->getProviders()) || 1 < array_reduce($this->sitemapProviderPool->getIndex(), function ($v1, Sitemap $v2) {
         return $v1 + $v2->getMaxPage();
     });
 }