function xmlsitemap_sitemap_get_max_filesize in XML sitemap 6.2
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_sitemap_get_max_filesize()
- 7.2 xmlsitemap.module \xmlsitemap_sitemap_get_max_filesize()
- 2.x xmlsitemap.module \xmlsitemap_sitemap_get_max_filesize()
Find the maximum file size of all a sitemap's XML files.
Parameters
$sitemap: The XML sitemap array.
Related topics
2 calls to xmlsitemap_sitemap_get_max_filesize()
- xmlsitemap_regenerate_batch_generate in ./
xmlsitemap.generate.inc - Batch callback; generate all pages of a sitemap.
- xmlsitemap_update_6203 in ./
xmlsitemap.install - Convert the xmlsitemap_max_filesize variable to a max_filesize column per-sitemap.
File
- ./
xmlsitemap.module, line 475 - Main file for the xmlsitemap module.
Code
function xmlsitemap_sitemap_get_max_filesize(stdClass &$sitemap) {
$dir = xmlsitemap_get_directory($sitemap);
$sitemap->max_filesize = 0;
foreach (file_scan_directory($dir, '\\.xml$') as $file) {
$sitemap->max_filesize = max($sitemap->max_filesize, filesize($file->filename));
}
return $sitemap->max_filesize;
}