diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index f86c40b087929232ef7bc951727ae3b65507fbba..e2290b0699ee20458eee21230e95508acbb8dad5 100755 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,11 @@ /** * \file htdocs/core/class/rssparser.class.php * \ingroup core - * \brief File of class to parse rss feeds + * \brief File of class to parse RSS feeds + */ + +/** + * Class to parse RSS files */ class RssParser { @@ -38,20 +42,38 @@ class RssParser private $_lastfetchdate; // Last successful fetch private $_rssarray=array(); + // For parsing with xmlparser + var $stack = array(); // parser stack + var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db=$db; + } + /** * getFormat * * @return string */ - public function getFormat() { + public function getFormat() + { return $this->_format; } + /** * getUrlRss * * @return string */ - public function getUrlRss() { + public function getUrlRss() + { return $this->_urlRSS; } /** @@ -59,7 +81,8 @@ class RssParser * * @return string */ - public function getLanguage() { + public function getLanguage() + { return $this->_language; } /** @@ -67,7 +90,8 @@ class RssParser * * @return string */ - public function getGenerator() { + public function getGenerator() + { return $this->_generator; } /** @@ -75,7 +99,8 @@ class RssParser * * @return string */ - public function getCopyright() { + public function getCopyright() + { return $this->_copyright; } /** @@ -83,7 +108,8 @@ class RssParser * * @return string */ - public function getLastBuildDate() { + public function getLastBuildDate() + { return $this->_lastbuilddate; } /** @@ -91,7 +117,8 @@ class RssParser * * @return string */ - public function getImageUrl() { + public function getImageUrl() + { return $this->_imageurl; } /** @@ -99,7 +126,8 @@ class RssParser * * @return string */ - public function getLink() { + public function getLink() + { return $this->_link; } /** @@ -107,7 +135,8 @@ class RssParser * * @return string */ - public function getTitle() { + public function getTitle() + { return $this->_title; } /** @@ -115,7 +144,8 @@ class RssParser * * @return string */ - public function getDescription() { + public function getDescription() + { return $this->_description; } /** @@ -123,7 +153,8 @@ class RssParser * * @return string */ - public function getLastFetchDate() { + public function getLastFetchDate() + { return $this->_lastfetchdate; } /** @@ -131,24 +162,9 @@ class RssParser * * @return string */ - public function getItems() { - return $this->_rssarray; - } - - - // For parsing with xmlparser - var $stack = array(); // parser stack - var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) + public function getItems() { - $this->db=$db; + return $this->_rssarray; }