<commit_before><?php

/**
 *  Sitemap plugin
 *
 *  @package Morfy
 *  @subpackage Plugins
 *  @author <NAME> / Awilum
 *  @copyright 2014 <NAME> / Awilum
 *  @version 1.0.0
 *
 */

 
if (Morfy::factory()->getUrl() == 'sitemap.xml') {
    Morfy::factory()->addAction('before_render', function() {
header("Content-Type: text/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$pages = Morfy::factory()->getPages(CONTENT_PATH, 'date', 'DESC', array('404'));
foreach($pages as $page) {
echo ('<url>
		<loc>'.$page['url'].'</loc>
		<lastmod>'.$page['date'].'</lastmod>
		<changefreq>weekly</changefreq>
		<priority>1.0</priority>
	</url>');
}
echo '
</urlset>
';

        exit();
    });
}
<commit_msg>Sitemap: fix page headers<commit_after><?php

/**
 *  Sitemap plugin
 *
 *  @package Morfy
 *  @subpackage Plugins
 *  @author <NAME> / Awilum
 *  @copyright 2014 <NAME> / Awilum
 *  @version 1.0.0
 *
 */

 
if (Morfy::factory()->getUrl() == 'sitemap.xml') {	
    Morfy::factory()->addAction('before_render', function() {
    	header($_SERVER['SERVER_PROTOCOL'].' 200 OK');
header("Content-Type: text/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$pages = Morfy::factory()->getPages(CONTENT_PATH, 'date', 'DESC', array('404'));
foreach($pages as $page) {
echo ('<url>
		<loc>'.$page['url'].'</loc>
		<lastmod>'.$page['date'].'</lastmod>
		<changefreq>weekly</changefreq>
		<priority>1.0</priority>
	</url>');
}
echo '
</urlset>
';

        exit();
    });
}

{'fraction_non_alphanumeric': 0.24212476837554045, 'fraction_numerical': 0.024088943792464484, 'mean_word_length': 4.1923076923076925, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 2, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5871506', 'n_tokens_mistral': 659, 'n_tokens_neox': 624, 'n_words': 102}