English
Kamil Dudka

Webové komponenty

Detail souboru

Jméno:Stáhnoutsitemap.xml.gz.xml [Stáhnout]
Umístění: src > page
Velikost:886 B
Poslední změna:2022-09-09 13:06

Zdrojový kód

<?xml version="1.0" encoding="utf-8"?>
<page id='sitemap.xml.gz' visible='no'>
  <name />
  <pageInit>
<?php
// Update SiteMap.php in cache directory if needed
ClassFactory::importClass('PageTransform');
$smCache = $docRoot.$config->cacheDir().'/SiteMap.php';
PageTransform::buildIfNeeded($smCache, 'SiteMapBuilder.xsl');
 
// Process SiteMap.php and catch output
ob_start();
echo '<'.'?xml version="1.0" encoding="UTF-8"?'.">\n"; // Do not concatenate string on this line
require($smCache);
$smContent = ob_get_contents();
ob_end_clean();
 
// Compress output using ZLIB
$tmpDir = $config->documentRoot().$config->tmpDir();
$tmpFile = tempnam($tmpDir, 'SM_XML_GZIP_');
$gz = gzopen($tmpFile, 'wb');
gzwrite($gz, $smContent);
gzclose($gz);
 
// Send to client
header('Content-type: application/x-gzip');
readfile($tmpFile);
unlink($tmpFile);
exit();
?>
  </pageInit>
  <MainPage />
</page>