Esempio n. 1
0
 /**
  * Update feed
  * 
  * @param string $feed feed url to update
  */
 public function update($feed = null)
 {
     $this->_init();
     require_once 'Ifphp/models/Feeds.php';
     $feeds = new Feeds();
     if ($feed) {
         $feed = $feeds->getBySiteUrl($feed);
         if (!$feed) {
             return;
         } else {
             $this->updateFeed($feed);
         }
     } else {
         $tfeeds = $feeds->fetchAll($feeds->select());
         if ($this->_registry->getRequest()->isPretend()) {
             echo 'This would update ' . $tfeeds->count() . ' feeds';
             exit;
         }
         foreach ($tfeeds as $feed) {
             $this->updateFeed($feed);
         }
     }
 }
Esempio n. 2
0
 /**
  * Ping site to check for updated posts
  */
 public function pingAction()
 {
     $form = $this->getPingForm();
     if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
         $feeds = new Feeds();
         $feed = $feeds->getBySiteUrl($form->url->getValue());
         $this->updateFeedPosts($feed);
     }
     $this->view->form = $form;
 }