You are here

function xmlsitemap_get_chunk_count in XML sitemap 6.2

Same name and namespace in other branches
  1. 8 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.

1 call to xmlsitemap_get_chunk_count()
XMLSitemapUnitTest::testGetChunkCount in ./xmlsitemap.test
Tests for xmlsitemap_get_chunk_count().

File

./xmlsitemap.module, line 1109
Main file for the xmlsitemap module.

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;
}