• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Feed_Reader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Feed_Reader的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed_Reader类的具体用法?PHP Zend_Feed_Reader怎么用?PHP Zend_Feed_Reader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Feed_Reader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _parse

 protected function _parse()
 {
     $feed = Zend_Feed_Reader::import($this->getLink());
     $this->_news = new Core_Model_Default(array('title' => $feed->getTitle(), 'link' => $feed->getLink(), 'dateModified' => $feed->getDateModified(), 'description' => $feed->getDescription(), 'language' => $feed->getLanguage(), 'entries' => array()));
     $data = array();
     foreach ($feed as $entry) {
         $picture = null;
         if ($entry->getEnclosure() && $entry->getEnclosure()->url) {
             $picture = $entry->getEnclosure()->url;
         }
         if ($entry->getDescription()) {
             $content = new Dom_SmartDOMDocument();
             $content->loadHTML($entry->getDescription());
             $content->encoding = 'utf-8';
             $description = $content->documentElement;
             $imgs = $description->getElementsByTagName('img');
             if ($imgs->length > 0) {
                 $img = $imgs->item(0);
                 if ($img->getAttribute('src')) {
                     $picture = $img->getAttribute('src');
                 }
             }
         }
         $edata = new Core_Model_Default(array('title' => $entry->getTitle(), 'description' => strip_tags($entry->getDescription()), 'dateModified' => $entry->getDateModified(), 'authors' => $entry->getAuthors(), 'link' => $entry->getLink(), 'content' => strip_tags($entry->getContent()), 'enclosure' => $entry->getEnclosure(), 'timestamp' => $entry->getDateCreated()->getTimestamp(), 'picture' => $picture));
         $data[] = $edata;
     }
     $this->_news->setEntries($data);
     return $this;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:29,代码来源:Abstract.php


示例2: getVideos

 public function getVideos($offset)
 {
     if (!$this->_videos) {
         $this->_videos = array();
         try {
             $this->_setYoutubeUrl($offset);
             $feed = Zend_Feed_Reader::import($this->getLink());
         } catch (Exception $e) {
             $feed = array();
         }
         foreach ($feed as $entry) {
             $params = Zend_Uri::factory($entry->getLink())->getQueryAsArray();
             $image = null;
             $link = null;
             if (!empty($params['v'])) {
                 $image = "http://img.youtube.com/vi/{$params['v']}/0.jpg";
                 $link = "http://www.youtube.com/embed/{$params['v']}";
             } else {
                 $link = $entry->getLink();
             }
             $video = new Core_Model_Default(array('video_id' => $params['v'], 'title' => $entry->getTitle(), 'description' => $entry->getContent(), 'link' => $link, 'image' => $image));
             $this->_videos[] = $video;
         }
     }
     return $this->_videos;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:26,代码来源:Youtube.php


示例3: updateFeed

 /**
  * Add feed to system
  * 
  * @param Feed $feed
  */
 private function updateFeed(Feed $feed)
 {
     require_once 'Ifphp/models/Posts.php';
     $feedSource = Zend_Feed_Reader::import($feed->url);
     $posts = new Posts();
     $tdate = $feedSource->current()->getDateModified();
     $tdate = new Zend_Date($tdate);
     while ($feedSource->valid() && $tdate->toValue() > $feed->lastPing && !$posts->getByLink($feedSource->current()->getPermaLink())) {
         $tdate = $feedSource->current()->getDateModified();
         $tdate = new Zend_Date($tdate);
         $defaultFilterChain = new Zend_Filter();
         $defaultFilterChain->addFilter(new Ifphp_Filter_XSSClean());
         $defaultFilterChain->addFilter(new Zend_Filter_StringTrim());
         $defaultFilterChain->addFilter(new Zend_Filter_StripTags());
         $post = $posts->createRow();
         $post->title = $defaultFilterChain->filter($feedSource->current()->getTitle());
         $post->description = $defaultFilterChain->filter($feedSource->current()->getDescription());
         $post->feedId = $defaultFilterChain->filter($feed->id);
         $post->link = $defaultFilterChain->filter($feedSource->current()->getPermaLink());
         $post->publishDate = $tdate->toValue();
         $post->save();
         Ifphp_Controller_Front::getInstance()->getPluginBroker()->addPost($post, $feed);
         $feedSource->next();
     }
     $feed->lastPing = time();
     $feed->save();
 }
开发者ID:aprondak,项目名称:ifphp,代码行数:32,代码来源:FeedProvider.php


示例4: pollAction

 /**
  * 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()
 {
     try {
         $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')) {
             Zend_Feed_Reader::setCache($chelper->getCache('feed'));
             Zend_Feed_Reader::useHttpConditionalGet();
         }
         $notifier = $this->_getTwitterNotifier();
         foreach ($feeds as $feed) {
             if ($notifier->isEnabled()) {
                 $feed->setTwitterNotifier($notifier);
             }
             $feed->setLuceneIndexer($this->_getLuceneIndexer());
             $feed->setLogger($this->getInvokeArg('bootstrap')->getResource('ErrorLog'));
             $feed->synchronise();
         }
         $this->_helper->getHelper('Cache')->removePagesTagged(array('allentries'));
         $this->_doPubsubhubbubNotification();
         echo 'Polling completed without error', PHP_EOL;
     } catch (Exception $e) {
         $logger = $this->getInvokeArg('bootstrap')->getResource('ErrorLog');
         $message = 'Other Error/Exception: ' . get_class($e) . ': ' . $e->getMessage() . PHP_EOL . 'Stack Trace: ' . PHP_EOL . $e->getTraceAsString();
         $logger->log($message, Zend_Log::ERR);
         echo $message;
     }
 }
开发者ID:padraic,项目名称:ZFPlanet,代码行数:40,代码来源:CronController.php


示例5: processAction

 public function processAction()
 {
     if (!$this->getRequest() instanceof ZFExt_Controller_Request_Cli) {
         throw new Exception('Access denied from HTTP');
     }
     try {
         $this->getInvokeArg('bootstrap')->addOptionRules(array('key|k=s' => 'File keyname for task data (required)'));
         $options = $this->getInvokeArg('bootstrap')->getGetOpt();
         $path = APPLICATION_PATH . '/../data/tmp/' . $options->key;
         $data = file_get_contents($path);
         $feed = Zend_Feed_Reader::importString($data);
         unlink($path);
         $feedModel = Doctrine_Core::getTable('Zfplanet_Model_Feed')->find($feed->getId());
         if ($feedModel) {
             $notifier = $this->_getTwitterNotification();
             if ($notifier->isEnabled()) {
                 $feedModel->setTwitterNotifier($notifier);
             }
             $feedModel->setLuceneIndexer($this->_getLuceneIndexer());
             $feedModel->synchronise($feed);
             $this->_helper->getHelper('Cache')->removePagesTagged(array('allentries'));
             $this->_helper->notifyHub(array('http://pubsubhubbub.appspot.com/'));
         } else {
             throw new Exception('Feed being processed does not match a known feed ID');
         }
     } catch (Exception $e) {
         $logger = $this->getInvokeArg('bootstrap')->getResource('ErrorLog');
         $message = 'Error/Exception encountered: ' . get_class($e) . ': ' . $e->getMessage() . PHP_EOL . 'Stack Trace: ' . PHP_EOL . $e->getTraceAsString();
         $logger->log($message, Zend_Log::ERR);
     }
 }
开发者ID:padraic,项目名称:ZFPlanet,代码行数:31,代码来源:CallbackController.php


示例6: getAuthors

 /**
  * Get an array with feed authors
  *
  * @return array
  */
 public function getAuthors()
 {
     if (array_key_exists('authors', $this->_data)) {
         return $this->_data['authors'];
     }
     $authors = array();
     $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:creator');
     if (!$list->length) {
         $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:creator');
     }
     if (!$list->length) {
         $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:publisher');
         if (!$list->length) {
             $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:publisher');
         }
     }
     if ($list->length) {
         foreach ($list as $author) {
             $authors[] = array('name' => $author->nodeValue);
         }
         $authors = new Zend_Feed_Reader_Collection_Author(Zend_Feed_Reader::arrayUnique($authors));
     } else {
         $authors = null;
     }
     $this->_data['authors'] = $authors;
     return $this->_data['authors'];
 }
开发者ID:siite,项目名称:choose-sa-cloud,代码行数:32,代码来源:Entry.php


示例7: getVideos

 public function getVideos($offset)
 {
     $cache = Zend_Registry::get('cache');
     //        if(($this->_videos = $cache->load('MEDIA_VIDEOS_ITUNES_'.sha1($this->getGalleryId().$this->getParam()))) === false ) {
     $this->_videos = array();
     try {
         $flux = Zend_Feed_Reader::import($this->getParam());
         if ($flux) {
             foreach ($flux as $entry) {
                 $image = $flux->getImage();
                 $podcast = $entry->getExtension('Podcast');
                 $extension = "";
                 if ($entry->getEnclosure()->url) {
                     $extension = explode(".", $entry->getEnclosure()->url);
                     $extension = $extension[count($extension) - 1];
                 }
                 $video = new Core_Model_Default(array('video_id' => $entry->getEnclosure()->url, 'title' => $entry->getTitle(), 'description' => $entry->getContent(), 'link' => $entry->getEnclosure()->url, 'extension' => $extension, 'image' => $podcast->getImage() ? $podcast->getImage() : $image['uri']));
                 $this->_videos[] = $video;
             }
         }
         $cache->save($this->_videos, 'MEDIA_VIDEOS_ITUNES_' . sha1($this->getGalleryId() . $this->getParam()));
     } catch (Exception $e) {
     }
     //        }
     return array_slice($this->_videos, $offset - 1, self::DISPLAYED_PER_PAGE);
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:26,代码来源:Itunes.php


示例8: __construct

 /**
  * Constructor
  *
  * @param  DOMDocument $dom
  * @param  string $type
  */
 public function __construct(DomDocument $dom, $type = null)
 {
     parent::__construct($dom, $type);
     $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed');
     $this->_extensions['Atom_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
     foreach ($this->_extensions as $extension) {
         $extension->setXpathPrefix('/atom:feed');
     }
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:15,代码来源:Atom.php


示例9: check

 /**
  * Checks the feeds for new news.
  */
 protected function check()
 {
     foreach ($this->uris as $uri) {
         $feed = Zend_Feed_Reader::import($uri);
         foreach ($feed as $entry) {
             $content = $this->getFixedContent($entry);
             NewsEditor::create($entry->getTitle(), $content, $entry->getLink());
         }
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:13,代码来源:NewsFeed.class.php


示例10: __construct

 /**
  * Constructor
  *
  * @param  DOMElement $entry
  * @param  int $entryKey
  * @param  string $type
  * @return void
  */
 public function __construct(DOMElement $entry, $entryKey, $type = null)
 {
     parent::__construct($entry, $entryKey, $type);
     // Everyone by now should know XPath indices start from 1 not 0
     $this->_xpathQuery = '//atom:entry[' . ($this->_entryKey + 1) . ']';
     $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Entry');
     $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type);
     $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Thread_Entry');
     $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type);
 }
开发者ID:mtday,项目名称:timesheet-system,代码行数:18,代码来源:Atom.php


示例11: indexAction

 public function indexAction()
 {
     $feedUrl = 'http://feeds.feedburner.com/ZendScreencastsVideoTutorialsAboutTheZendPhpFrameworkForDesktop';
     $feed = Zend_Feed_Reader::import($feedUrl);
     $this->view->gettingStarted = array();
     foreach ($feed as $entry) {
         if (array_search('Getting Started', $entry->getCategories()->getValues())) {
             $this->view->gettingStarted[$entry->getLink()] = $entry->getTitle();
         }
     }
 }
开发者ID:tests1,项目名称:zendcasts,代码行数:11,代码来源:IndexController.php


示例12: isValid

 /**
  * Defined by Zend_Validate_Interface
  *
  * Returns true if and only if $value is a valid IP address
  *
  * @param mixed $value
  * @return boolean
  */
 public function isValid($value)
 {
     $valueString = (string) $value;
     $this->_setValue($valueString);
     try {
         Zend_Feed_Reader::import($valueString);
     } catch (Zend_Feed_Exception $e) {
         $this->_error(self::NOT_URL);
         return false;
     }
     return true;
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:20,代码来源:Feed.php


示例13: _initFeed

 protected function _initFeed()
 {
     // set cache frontend options
     $frontendOptions = array('lifetime' => 86400, 'automatic_serialization' => true);
     // set cache backend options
     $backendOptions = array('cache_dir' => APPLICATION_PATH . '/../data/cache');
     // configure cache
     $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
     // set feed to use cache and httpConditionalGet
     Zend_Feed_Reader::setCache($cache);
     Zend_Feed_Reader::useHttpConditionalGet();
 }
开发者ID:richistron,项目名称:Ofelia,代码行数:12,代码来源:Bootstrap.php


示例14: detectHubs

 /**
  * Simple utility function which imports any feed URL and
  * determines the existence of Hub Server endpoints. This works
  * best if directly given an instance of Zend_Feed_Reader_Atom|Rss
  * to leverage off.
  *
  * @param  Zend_Feed_Reader_FeedAbstract|Zend_Feed_Abstract|string $source
  * @return array
  */
 public static function detectHubs($source)
 {
     if (is_string($source)) {
         $feed = Zend_Feed_Reader::import($source);
     } elseif (is_object($source) && $source instanceof Zend_Feed_Reader_FeedAbstract) {
         $feed = $source;
     } elseif (is_object($source) && $source instanceof Zend_Feed_Abstract) {
         $feed = Zend_Feed_Reader::importFeed($source);
     } else {
         throw new Zend_Feed_Pubsubhubbub_Exception('The source parameter was' . ' invalid, i.e. not a URL string or an instance of type' . ' Zend_Feed_Reader_FeedAbstract or Zend_Feed_Abstract');
     }
     return $feed->getHubs();
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:22,代码来源:Pubsubhubbub.php


示例15: processAction

 public function processAction()
 {
     $form = new Admin_Form_AddBlog();
     if (!$this->getRequest()->isPost()) {
         return $this->_forward('admin/index');
     }
     $flashMessenger = $this->_helper->getHelper('FlashMessenger');
     if (!$form->isValid($_POST)) {
         $flashMessenger->addMessage('Form data invalid: recheck details and try again.');
         $flashMessenger->addMessage('error');
         $this->_redirect('/admin/blog/create');
     }
     $values = $form->getValues();
     $blog = new Zfplanet_Model_Blog();
     $blog->contactName = $values['contactName'];
     if (isset($values['contactEmail'])) {
         $blog->contactEmail = $values['contactEmail'];
     }
     $blog->uri = $values['uri'];
     try {
         $data = Zend_Feed_Reader::import($values['feedUri']);
     } catch (Exception $e) {
         $flashMessenger->addMessage('Problem fetching feed: ' . $e->getMessage());
         $flashMessenger->addMessage('error');
         $this->_redirect('/admin/blog/create');
     }
     $blog->feedId = $data->getId();
     $feed = new Zfplanet_Model_Feed();
     $feedMeta = new Zfplanet_Model_FeedMeta();
     $feed->id = $data->getId();
     $feed->uri = $data->getFeedLink();
     if (isset($feed->uri)) {
         $feed->uri = $values['feedUri'];
     }
     $feed->blogId = $blog->id;
     $feed->title = Zfplanet_Model_Feed::getHtmlPurifier()->purify($data->getTitle());
     $feed->type = $this->_getFeedVersion($data->getType());
     $feed->isActive = 1;
     $feedMeta->feedId = $data->getId();
     $feedMeta->title = $data->getTitle();
     $feedMeta->description = $data->getDescription();
     $feedMeta->link = $data->getLink();
     $feedMeta->feedLink = $data->getFeedLink();
     $blog->save();
     $feed->save();
     $feedMeta->save();
     $this->_checkPubsubEnabled($data);
     $flashMessenger->addMessage('Blog successfully added!');
     $flashMessenger->addMessage('success');
     $this->_redirect('/admin/blog/create');
 }
开发者ID:padraic,项目名称:ZFPlanet,代码行数:51,代码来源:BlogController.php


示例16: _parse

 protected function _parse()
 {
     $feed = Zend_Feed_Reader::import($this->getLink());
     $this->_news = new Core_Model_Default(array('title' => $feed->getTitle(), 'link' => $feed->getLink(), 'dateModified' => $feed->getDateModified(), 'description' => $feed->getDescription(), 'language' => $feed->getLanguage(), 'entries' => array()));
     $data = array();
     foreach ($feed as $entry) {
         $picture = null;
         if ($entry->getEnclosure() && $entry->getEnclosure()->url) {
             $picture = $entry->getEnclosure()->url;
         }
         $description = "";
         if ($entry->getContent()) {
             $content = new Dom_SmartDOMDocument();
             $content->loadHTML($entry->getContent());
             $content->encoding = 'utf-8';
             $description = $content->documentElement;
             $imgs = $description->getElementsByTagName('img');
             if ($imgs->length > 0) {
                 foreach ($imgs as $k => $img) {
                     if ($k == 0) {
                         $img = $imgs->item(0);
                         if ($img->getAttribute('src') and stripos($img->getAttribute('src'), ".gif") === false) {
                             $picture = $img->getAttribute('src');
                             $img->parentNode->removeChild($img);
                         }
                     }
                     $img->removeAttribute('width');
                     $img->removeAttribute('height');
                 }
             }
             $as = $description->getElementsByTagName('a');
             if ($as->length > 0) {
                 foreach ($as as $a) {
                     $a->setAttribute('target', '_self');
                 }
             }
             $description = $content->saveHTMLExact();
         }
         $timestamp = $entry->getDateCreated() ? $entry->getDateCreated()->getTimestamp() : null;
         $updated_at = null;
         if ($timestamp) {
             $updated_at = $this->_getUpdatedAt($timestamp);
         }
         $edata = new Core_Model_Default(array('entry_id' => $entry->getId(), 'title' => $entry->getTitle(), 'description' => $description, 'short_description' => strip_tags($description), 'dateModified' => $entry->getDateModified(), 'authors' => $entry->getAuthors(), 'link' => $entry->getLink(), 'content' => $description, 'enclosure' => $entry->getEnclosure(), 'timestamp' => $timestamp, 'updated_at' => $updated_at, 'picture' => $picture));
         $data[] = $edata;
     }
     $this->_news->setEntries($data);
     return $this;
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:49,代码来源:Abstract.php


示例17: _orderRssNews

 private function _orderRssNews($rss_list)
 {
     $feeds = array();
     $errors = array();
     $id_source = 0;
     if (isset($_COOKIE['id_' . $this->_id_page])) {
         $id_source = $_COOKIE['detail_source_' . $this->_id_page];
     }
     $flag = false;
     $cache = $this->_getCache();
     foreach ($rss_list as $rss_key => $rss) {
         try {
             $cache_key = PREFIXED_CACHE_RSS_URL . md5($rss['link']);
             $rss_news = $cache->load($cache_key);
             if (!$rss_news) {
                 $feed = Zend_Feed_Reader::import($rss['link']);
                 $arrFeeds = array();
                 foreach ($feed as $entry) {
                     $itemRSS = array("title" => $entry->getTitle(), "dateModified" => $entry->getDateModified(), "description" => $entry->getDescription(), "link" => $entry->getLink(), "commentLink" => $entry->getCommentLink());
                     $arrFeeds[] = $itemRSS;
                 }
                 $rss_news = array('link' => $feed->getLink(), 'entries' => $arrFeeds);
                 $cache->save($rss_news, $cache_key, array(), TIMELIFE_CACHE_RSS_URL);
             }
             if (!$flag && $id_source == $rss['id']) {
                 $flag = true;
             }
             $entries = array();
             $index = 0;
             foreach ($rss_news["entries"] as $entry) {
                 if ($index >= $rss['num_stories']) {
                     break;
                 }
                 $news = array("title" => $entry["title"], "dateModified" => $entry["dateModified"], "description" => $entry["description"], "link" => $entry["link"], "commentLink" => $entry["commentLink"]);
                 $entries[$index] = $news;
                 $index++;
             }
             $rss_feeds = array('title' => $rss['title'], 'link' => $rss_news["link"], 'entries' => $entries, 'is_allow_comment' => $rss["is_allow_comment"]);
             $feeds[$rss['id']] = $rss_feeds;
         } catch (Exception $e) {
             $feeds[$rss['id']] = array('title' => $rss['title'], 'entries' => $this->translate('ERR_CANNOT_LOAD_DATA_FROM_RSS_LINK'));
             $errors[] = $rss['link'];
         }
     }
     if (!$flag) {
         setcookie('detail_source_' . $this->_id_page, "all", time() + 7 * 24 * 60 * 60, '/');
     }
     return $feeds;
 }
开发者ID:BGCX067,项目名称:facebook-store-svn-to-git,代码行数:49,代码来源:CartsController.php


示例18: __construct

 /**
  * Constructor
  *
  * @param  Zend_Feed_Abstract $feed The source Zend_Feed object
  * @param  string $type Feed type
  * @return void
  */
 public function __construct(DomDocument $dom, $type = null, DOMXPath $xpath = null)
 {
     $this->_domDocument = $dom;
     if ($type !== null) {
         $this->_data['type'] = $type;
     } else {
         $this->_data['type'] = Zend_Feed_Reader::detectType($dom);
     }
     if ($xpath !== null) {
         $this->_xpath = $xpath;
     } else {
         $this->_xpath = new DOMXPath($this->_domDocument);
     }
     $this->_registerNamespaces();
 }
开发者ID:bartolomeu,项目名称:estoque_gusella,代码行数:22,代码来源:FeedAbstract.php


示例19: __construct

 /**
  * Constructor: Create a Source object which is largely just a normal
  * Zend_Feed_Reader_FeedAbstract object only designed to retrieve feed level
  * metadata from an Atom entry's source element.
  *
  * @param DOMElement $source
  * @param string $xpathPrefix Passed from parent Entry object
  * @param string $type Nearly always Atom 1.0
  */
 public function __construct(DOMElement $source, $xpathPrefix, $type = Zend_Feed_Reader::TYPE_ATOM_10)
 {
     $this->_domDocument = $source->ownerDocument;
     $this->_xpath = new DOMXPath($this->_domDocument);
     $this->_data['type'] = $type;
     $this->_registerNamespaces();
     $this->_loadExtensions();
     $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed');
     $this->_extensions['Atom_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
     $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Feed');
     $this->_extensions['DublinCore_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
     foreach ($this->_extensions as $extension) {
         $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
     }
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:24,代码来源:Source.php


示例20: homepagelistAction

 /**
  * Overwrite the function define in the SiteMapInterface implement in Cible_Controller_Action
  *
  * This function return the sitemap specific for this module
  *
  * @access public
  *
  * @return a string containing xml sitemap
  */
 public function homepagelistAction()
 {
     $_blockID = $this->_request->getParam('BlockID');
     $languageID = Zend_Registry::get('languageID');
     $link = Cible_FunctionsBlocks::getBlockParameter($_blockID, $languageID);
     $linkMax = Cible_FunctionsBlocks::getBlockParameter($_blockID, 3);
     $block_info = Cible_FunctionsBlocks::getBlockDetails($_blockID);
     $db = Zend_Registry::get("db");
     $feed = Zend_Feed_Reader::import($link);
     $data = array('block_title' => $block_info["BI_BlockTitle"], 'linkMax' => $linkMax, 'title' => $feed->getTitle(), 'link' => $feed->getLink(), 'dateModified' => $feed->getDateModified(), 'description' => $feed->getDescription(), 'language' => $feed->getLanguage(), 'entries' => array());
     foreach ($feed as $entry) {
         $edata = array('title' => $entry->getTitle(), 'description' => $entry->getDescription(), 'dateModified' => $entry->getDateModified(), 'authors' => $entry->getAuthors(), 'link' => $entry->getLink(), 'content' => $entry->getContent());
         $data['entries'][] = $edata;
     }
     $this->view->data = $data;
 }
开发者ID:anunay,项目名称:stentors,代码行数:25,代码来源:IndexController.php



注:本文中的Zend_Feed_Reader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Feed_Reader_FeedAbstract类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Feed_Pubsubhubbub类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap