<commit_before><?php

class Zfplanet_CronController extends Zend_Controller_Action
{

    public function init()
    {
        if (!$this->getRequest() instanceof ZFExt_Controller_Request_Cli) {
            throw new Exception('Access denied from HTTP');
        }
    }

    public function pollAction()
    {
        $feeds = Doctrine_Query::create()
            ->from('Zfplanet_Model_Feed')
            ->execute();
        if (!$feeds) {
            return;
        }
        $chelper = $this->_helper->getHelper('Cache');
        if ($chelper->hasCache('feed')) {
            Zend_Feed_Reader::setCache($chelper->getCache('feed'));
            Zend_Feed_Reader::useHttpConditionalGet();
        }
        foreach($feeds as $feed) {<commit_msg>When polling omit Pubsubhubbub subscribed feeds (they are updated in real time separately)<commit_after><?php

class Zfplanet_CronController extends Zend_Controller_Action
{

    public function init()
    {
        if (!$this->getRequest() instanceof ZFExt_Controller_Request_Cli) {
            throw new Exception('Access denied from HTTP');
        }
    }

    /**
     * Polls all registered feeds. The actual polling is performed by the
     * retrieved Models, so all we do here is get those Models and setup
     * Zend_Feed_Reader caching/conditional GET support if configured.
     * Polling is NOT performed for feeds which have a confirmed Pubsubhubbub
     * subscription active.
     *
     * @return void
     */
    public function pollAction()
    {
        $feeds = Doctrine_Query::create()
            ->from('Zfplanet_Model_Feed f')
            ->where(
                'f.uri NOT IN (SELECT s.topic_url FROM Zfplanet_Model_Subscription s WHERE s.subscription_state = ?)',
                Zend_Feed_Pubsubhubbub::SUBSCRIPTION_VERIFIED
            )->execute();
        if (!$feeds) {
            return;
        }
        $chelper = $this->_helper->getHelper('Cache');
        if ($chelper->hasCache('feed')) {
            // configured for refreshing cached content at maximum
            // 1 week intervals by default (see cli.ini)
            Zend_Feed_Reader::setCache($chelper->getCache('feed'));
            Zend_Feed_Reader::useHttpConditionalGet();
        }
        foreach($feeds as $feed) {
{'fraction_non_alphanumeric': 0.10435931307793923, 'fraction_numerical': 0.00044033465433729633, 'mean_word_length': 2.3859910581222055, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3017274', 'n_tokens_mistral': 640, 'n_tokens_neox': 620, 'n_words': 158}