<commit_before><?php

/**
 * Pimcoresitemapplugin_SitemapController
 *
 * @author <NAME>
 */

use Byng\Pimcore\Sitemap\SitemapPlugin as SitemapPlugin;

class Pimcoresitemapplugin_SitemapController extends \Pimcore\Controller\Action\Frontend
{

    public function viewAction()
    {
        // Special case: subsite in the tree
        if (Site::isSiteRequest()) {
            $site = Site::getCurrentSite();
            $filename = '/' . $site->getMainDomain() . '.xml';
        } else {
            // Default filename
            $filename = '/'. \Pimcore\Config::getSystemConfig()->get("general")->get("domain") . '.xml';
        }<commit_msg>Retrieve siteRequest from document (useful when proxying domains to subfolders)<commit_after><?php

/**
 * Pimcoresitemapplugin_SitemapController
 *
 * @author <NAME>
 */

use Byng\Pimcore\Sitemap\SitemapPlugin as SitemapPlugin;

class Pimcoresitemapplugin_SitemapController extends \Pimcore\Controller\Action\Frontend
{

    /*
     * Shows the sitemap.xml of the currently visited website
     */
    public function viewAction()
    {
        // Special case: subsite in the tree
        if (isset($this->document) && $site = \Pimcore\Tool\Frontend::getSiteForDocument($this->document)) {
            $filename = '/' . $site->getMainDomain() . '.xml';
        } else {
            // Default filename
            $filename = '/'. \Pimcore\Config::getSystemConfig()->get("general")->get("domain") . '.xml';
        }
{'fraction_non_alphanumeric': 0.14061433447098975, 'fraction_numerical': 0.0, 'mean_word_length': 2.8177083333333335, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '7200011', 'n_tokens_mistral': 446, 'n_tokens_neox': 443, 'n_words': 85}