<commit_before><?php
abstract class Kwc_Abstract_Feed_Component extends Kwc_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['contentSender'] = 'Kwc_Abstract_Feed_ContentSender';
        return $ret;
    }

    abstract protected function _getRssEntries();

    protected function _getRssTitle()
    {
        return Zend_Registry::get('config')->application->name;
    }

    public function getXml()
    {
        $cache = Kwf_Component_Cache::getInstance();
        if (!$xml = $cache->load($this->getData())) {
            $xml = $this->_getFeedXml();
            $cache->save($this->getData(), $xml);
        }
        return $xml;
    }

    private function _getFeedXml()
    {
        $host = isset($_SERVER['HTTP_HOST']) ? 'http://' . $_SERVER['HTTP_HOST'] : '';
        $feedArray = array(
            'title' => $this->_getRssTitle(),
            'link' => $host.$this->getUrl(),
            //'lastUpdate' => ,
            'charset' => 'utf-8',
            'description' => '',
            //'author' => ,
            //'email' => ,
            'copyright' => Zend_Registry::get('config')->application->name,
            'generator' => 'Vivid Planet Software GmbH',
            'language' => 'de', //TODO
            'entries' => $this->_getRssEntries()
        );
        $feed = Zend_Feed::importArray($feedArray, 'rss');
        return $feed->saveXml();
    }
}<commit_msg>improve feed meta data<commit_after><?php
abstract class Kwc_Abstract_Feed_Component extends Kwc_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['contentSender'] = 'Kwc_Abstract_Feed_ContentSender';
        return $ret;
    }

    abstract protected function _getRssEntries();

    protected function _getRssTitle()
    {
        return Zend_Registry::get('config')->application->name;
    }

    public function getXml()
    {
        $cache = Kwf_Component_Cache::getInstance();
        if (!$xml = $cache->load($this->getData())) {
            $xml = $this->_getFeedXml();
            $cache->save($this->getData(), $xml);
        }
        return $xml;
    }

    private function _getFeedXml()
    {
        $host = isset($_SERVER['HTTP_HOST']) ? 'http://' . $_SERVER['HTTP_HOST'] : '';
        $feedArray = array(
            'title' => $this->_getRssTitle(),
            'link' => $host.$this->getUrl(),
            //'lastUpdate' => ,
            'charset' => 'utf-8',
            'description' => '',
            //'author' => ,
            //'email' => ,
            'copyright' => Zend_Registry::get('config')->application->name,
            'generator' => 'Koala Framework',
            'language' => $this->getData()->getLanguage(),
            'entries' => $this->_getRssEntries()
        );
        $feed = Zend_Feed::importArray($feedArray, 'rss');
        return $feed->saveXml();
    }
}
{'fraction_non_alphanumeric': 0.17124227865477007, 'fraction_numerical': 0.0006863417982155113, 'mean_word_length': 2.1927710843373496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3493547', 'n_tokens_mistral': 845, 'n_tokens_neox': 831, 'n_words': 150}