<commit_before><?php
class Vpc_Root_DomainRoot_Component extends Vpc_Root_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['generators']['domain'] = array(
            'class' => 'Vpc_Root_DomainRoot_Generator',
            'component' => 'Vpc_Root_DomainRoot_Domain_Component',
            'model' => 'Vpc_Root_DomainRoot_Model'
        );
        return $ret;
    }

    public function formatPath($parsedUrl)
    {
        if (!isset($parsedUrl['host']))
            throw new Vps_Exception("Host is missing in url '$url'");
        $host = $parsedUrl['host'];
        $setting = $this->_getSetting('generators');
        $modelName = $setting['domain']['model'];
        $model = Vps_Model_Abstract::getInstance($modelName);
        $path =
            '/' .
            $model->getRow($model->select()->whereEquals('domain', $host))->id .
            $parsedUrl['path'];
        return $path;
    }
}<commit_msg>Eigene Exception wenn keine Domains gesetzt<commit_after><?php
class Vpc_Root_DomainRoot_Component extends Vpc_Root_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['generators']['domain'] = array(
            'class' => 'Vpc_Root_DomainRoot_Generator',
            'component' => 'Vpc_Root_DomainRoot_Domain_Component',
            'model' => 'Vpc_Root_DomainRoot_Model'
        );
        return $ret;
    }

    public function formatPath($parsedUrl)
    {
        if (!isset($parsedUrl['host']))
            throw new Vps_Exception("Host is missing in url '$url'");
        $host = $parsedUrl['host'];
        $setting = $this->_getSetting('generators');
        $modelName = $setting['domain']['model'];
        $model = Vps_Model_Abstract::getInstance($modelName);
        $row = $model->getRow($model->select()->whereEquals('domain', $host));
        if (!$row)
            throw new Vps_Exception("Domain $host not found, please enter in config");
        $path =
            '/' .
            $row->id .
            $parsedUrl['path'];
        return $path;
    }
}
{'fraction_non_alphanumeric': 0.14827096162955944, 'fraction_numerical': 0.0, 'mean_word_length': 2.561551433389545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1343465', 'n_tokens_mistral': 599, 'n_tokens_neox': 607, 'n_words': 115}