dolibarr  7.0.0-beta
Public Member Functions | List of all members
RssParser Class Reference

Class to parse RSS files. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 getFormat ()
 getFormat More...
 
 getUrlRss ()
 getUrlRss More...
 
 getLanguage ()
 getLanguage More...
 
 getGenerator ()
 getGenerator More...
 
 getCopyright ()
 getCopyright More...
 
 getLastBuildDate ()
 getLastBuildDate More...
 
 getImageUrl ()
 getImageUrl More...
 
 getLink ()
 getLink More...
 
 getTitle ()
 getTitle More...
 
 getDescription ()
 getDescription More...
 
 getLastFetchDate ()
 getLastFetchDate More...
 
 getItems ()
 getItems More...
 
 parser ($urlRSS, $maxNb=0, $cachedelay=60, $cachedir='')
 Parse rss URL. More...
 
 feed_start_element ($p, $element, &$attrs)
 Triggered when opened tag is found. More...
 
 feed_cdata ($p, $text)
 Triggered when CDATA is found. More...
 
 feed_end_element ($p, $el)
 Triggered when closed tag is found. More...
 
 concat (&$str1, $str2="")
 To concat 2 string with no warning if an operand is not defined. More...
 
 append_content ($text)
 Enter description here ... More...
 
 append ($el, $text)
 smart append - field and namespace aware More...
 

Detailed Description

Class to parse RSS files.

Definition at line 27 of file rssparser.class.php.

Constructor & Destructor Documentation

RssParser::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 55 of file rssparser.class.php.

Member Function Documentation

RssParser::append (   $el,
  $text 
)

smart append - field and namespace aware

Parameters
string$elEl
string$textText
Returns
void

Definition at line 689 of file rssparser.class.php.

References concat().

Referenced by feed_cdata(), and feed_start_element().

RssParser::append_content (   $text)

Enter description here ...

Parameters
string$textText
Returns
void

Definition at line 672 of file rssparser.class.php.

References concat().

Referenced by feed_cdata(), feed_end_element(), and feed_start_element().

RssParser::concat ( $str1,
  $str2 = "" 
)

To concat 2 string with no warning if an operand is not defined.

Parameters
string$str1Str1
string$str2Str2
Returns
string String cancatenated

Definition at line 658 of file rssparser.class.php.

Referenced by append(), and append_content().

RssParser::feed_cdata (   $p,
  $text 
)

Triggered when CDATA is found.

Parameters
string$pP
string$textTag
Returns
void

Definition at line 584 of file rssparser.class.php.

References append(), and append_content().

RssParser::feed_end_element (   $p,
  $el 
)

Triggered when closed tag is found.

Parameters
string$pP
string$elTag
Returns
void

Definition at line 604 of file rssparser.class.php.

References append_content().

RssParser::feed_start_element (   $p,
  $element,
$attrs 
)

Triggered when opened tag is found.

Parameters
string$pStart
string$elementTag
array$attrsAttributes of tags
Returns
void

Definition at line 465 of file rssparser.class.php.

References append(), and append_content().

RssParser::getCopyright ( )

getCopyright

Returns
string

Definition at line 102 of file rssparser.class.php.

RssParser::getDescription ( )

getDescription

Returns
string

Definition at line 147 of file rssparser.class.php.

RssParser::getFormat ( )

getFormat

Returns
string

Definition at line 65 of file rssparser.class.php.

RssParser::getGenerator ( )

getGenerator

Returns
string

Definition at line 93 of file rssparser.class.php.

RssParser::getImageUrl ( )

getImageUrl

Returns
string

Definition at line 120 of file rssparser.class.php.

RssParser::getItems ( )

getItems

Returns
string

Definition at line 165 of file rssparser.class.php.

RssParser::getLanguage ( )

getLanguage

Returns
string

Definition at line 84 of file rssparser.class.php.

RssParser::getLastBuildDate ( )

getLastBuildDate

Returns
string

Definition at line 111 of file rssparser.class.php.

RssParser::getLastFetchDate ( )

getLastFetchDate

Returns
string

Definition at line 156 of file rssparser.class.php.

RssParser::getLink ( )

getLink

Returns
string

Definition at line 129 of file rssparser.class.php.

RssParser::getTitle ( )

getTitle

Returns
string

Definition at line 138 of file rssparser.class.php.

RssParser::getUrlRss ( )

getUrlRss

Returns
string

Definition at line 75 of file rssparser.class.php.

RssParser::parser (   $urlRSS,
  $maxNb = 0,
  $cachedelay = 60,
  $cachedir = '' 
)

Parse rss URL.

Parameters
string$urlRSSUrl to parse
int$maxNbMax nb of records to get (0 for no limit)
int$cachedelay0=No cache, nb of seconds we accept cache files (cachedir must also be defined)
string$cachedirDirectory where to save cache file
Returns
int <0 if KO, >0 if OK

Definition at line 180 of file rssparser.class.php.

References dol_filemtime(), dol_hash(), dol_is_dir(), dol_is_url(), dol_mkdir(), dol_now(), dol_syslog(), if, print, and xml2php().


The documentation for this class was generated from the following file: