You are here

function xmlsitemap_get_chunk_count in XML sitemap 8

Same name and namespace in other branches
  1. 6.2 xmlsitemap.module \xmlsitemap_get_chunk_count()
  2. 7.2 xmlsitemap.module \xmlsitemap_get_chunk_count()
  3. 2.x xmlsitemap.module \xmlsitemap_get_chunk_count()

Get the current number of sitemap chunks.

@static int $chunks Number of chunks.

Parameters

int $reset: If TRUE, reset number of chunks.

Return value

int Number of chunks.

1 call to xmlsitemap_get_chunk_count()
XmlSitemapUnitTest::testGetChunkCount in tests/src/Functional/XmlSitemapUnitTest.php
Tests for xmlsitemap_get_chunk_count().

File

./xmlsitemap.module, line 1061
xmlsitemap XML sitemap

Code

function xmlsitemap_get_chunk_count($reset = FALSE) {
  static $chunks;
  if (!isset($chunks) || $reset) {
    $count = max(xmlsitemap_get_link_count($reset), 1);
    $chunks = ceil($count / xmlsitemap_get_chunk_size($reset));
  }
  return $chunks;
}