function finish_file() { global $sitemapstr, $numlinks, $fileindex, $isFinish, $need_cdata; $sitemapstr .= get_file_finish(); $fname = "ymlcatalog.xml"; if (!$need_cdata) { $fname = "ymlcatalog2.xml"; } $file = fopen($fname, 'w'); fwrite($file, $sitemapstr); fclose($file); echo "Выгрузка окончена"; return 1; }
function finish_file() { global $sitemapstr, $numlinks, $fileindex, $isFinish; $sitemapstr .= get_file_finish(); $file = fopen("sitemap" . $fileindex . ".xml", 'w'); echo "sitemap" . $fileindex . ".xml - выгружен<br>"; fwrite($file, $sitemapstr); $fileindex++; $sitemapstr = ""; $numlinks = 0; $sitemapstr .= get_file_start(); fclose($file); $isFinish = true; return 1; }