Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe SimplePie
+ Graphe d'héritage de SimplePie:

Fonctions membres publiques

 __construct ()
 
 __toString ()
 
 __destruct ()
 
 force_feed ($enable=false)
 
 set_feed_url ($url)
 
 set_file (&$file)
 
 set_raw_data ($data)
 
 set_timeout ($timeout=10)
 
 force_fsockopen ($enable=false)
 
 enable_cache ($enable=true)
 
 set_cache_duration ($seconds=3600)
 
 set_autodiscovery_cache_duration ($seconds=604800)
 
 set_cache_location ($location='./cache')
 
 enable_order_by_date ($enable=true)
 
 set_input_encoding ($encoding=false)
 
 set_autodiscovery_level ($level=SIMPLEPIE_LOCATOR_ALL)
 
get_registry ()
 
 set_cache_class ($class='SimplePie_Cache')
 
 set_locator_class ($class='SimplePie_Locator')
 
 set_parser_class ($class='SimplePie_Parser')
 
 set_file_class ($class='SimplePie_File')
 
 set_sanitize_class ($class='SimplePie_Sanitize')
 
 set_item_class ($class='SimplePie_Item')
 
 set_author_class ($class='SimplePie_Author')
 
 set_category_class ($class='SimplePie_Category')
 
 set_enclosure_class ($class='SimplePie_Enclosure')
 
 set_caption_class ($class='SimplePie_Caption')
 
 set_copyright_class ($class='SimplePie_Copyright')
 
 set_credit_class ($class='SimplePie_Credit')
 
 set_rating_class ($class='SimplePie_Rating')
 
 set_restriction_class ($class='SimplePie_Restriction')
 
 set_content_type_sniffer_class ($class='SimplePie_Content_Type_Sniffer')
 
 set_source_class ($class='SimplePie_Source')
 
 set_useragent ($ua=SIMPLEPIE_USERAGENT)
 
 set_cache_name_function ($function='md5')
 
 set_stupidly_fast ($set=false)
 
 set_max_checked_feeds ($max=10)
 
 remove_div ($enable=true)
 
 strip_htmltags ($tags='', $encode=null)
 
 encode_instead_of_strip ($enable=true)
 
 strip_attributes ($attribs='')
 
 set_output_encoding ($encoding='UTF-8')
 
 strip_comments ($strip=false)
 
 set_url_replacements ($element_attribute=null)
 
 set_image_handler ($page=false, $qs='i')
 
 set_item_limit ($limit=0)
 
 init ()
 
 error ()
 
 get_raw_data ()
 
 get_encoding ()
 
 handle_content_type ($mime='text/html')
 
 get_type ()
 
 subscribe_url ()
 
 get_feed_tags ($namespace, $tag)
 
 get_channel_tags ($namespace, $tag)
 
 get_image_tags ($namespace, $tag)
 
 get_base ($element=array())
 
 sanitize ($data, $type, $base='')
 
 get_title ()
 
 get_category ($key=0)
 
 get_categories ()
 
 get_author ($key=0)
 
 get_authors ()
 
 get_contributor ($key=0)
 
 get_contributors ()
 
 get_link ($key=0, $rel='alternate')
 
 get_permalink ()
 
 get_links ($rel='alternate')
 
 get_all_discovered_feeds ()
 
 get_description ()
 
 get_copyright ()
 
 get_language ()
 
 get_latitude ()
 
 get_longitude ()
 
 get_image_title ()
 
 get_image_url ()
 
 get_image_link ()
 
 get_image_width ()
 
 get_image_height ()
 
 get_item_quantity ($max=0)
 
 get_item ($key=0)
 
 get_items ($start=0, $end=0)
 
 set_favicon_handler ($page=false, $qs='i')
 
 get_favicon ()
 
 __call ($method, $args)
 

Fonctions membres publiques statiques

static sort_items ($a, $b)
 
static merge_items ($urls, $start=0, $end=0, $limit=0)
 

Champs de données

 $data = array()
 
 $error
 
 $sanitize
 
 $useragent = SIMPLEPIE_USERAGENT
 
 $feed_url
 
 $file
 
 $raw_data
 
 $timeout = 10
 
 $force_fsockopen = false
 
 $force_feed = false
 
 $cache = true
 
 $cache_duration = 3600
 
 $autodiscovery_cache_duration = 604800
 
 $cache_location = './cache'
 
 $cache_name_function = 'md5'
 
 $order_by_date = true
 
 $input_encoding = false
 
 $autodiscovery = SIMPLEPIE_LOCATOR_ALL
 
 $registry
 
 $max_checked_feeds = 10
 
 $all_discovered_feeds = array()
 
 $image_handler = ''
 
 $multifeed_url = array()
 
 $multifeed_objects = array()
 
 $config_settings = null
 
 $item_limit = 0
 
 $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc')
 
 $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style')
 

Fonctions membres protégées

 fetch_data (&$cache)
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( )

The SimplePie class contains feed level data and options

To use SimplePie, create the SimplePie object with no parameters. You can then set configuration options using the provided methods. After setting them, you must initialise the feed using $feed->init(). At that point the object's methods and properties will be available to you.

Previously, it was possible to pass in the feed URL along with cache options directly into the constructor. This has been removed as of 1.3 as it caused a lot of confusion.

Depuis
1.0 Preview Release

Références init(), sanitize(), set_cache_duration(), set_cache_location(), et set_feed_url().

◆ __destruct()

__destruct ( )

Remove items that link back to this before destroying this object

Références $item.

Documentation des fonctions membres

◆ __call()

__call (   $method,
  $args 
)

Magic method handler

Paramètres
string$methodMethod name
array$argsArguments to the method
Renvoie
mixed

Références $class, et $file.

◆ __toString()

__toString ( )

Used for converting object to a string

◆ enable_cache()

enable_cache (   $enable = true)

Enable/disable caching in SimplePie.

This option allows you to disable caching all-together in SimplePie. However, disabling the cache can lead to longer load times.

Depuis
1.0 Preview Release
Paramètres
bool$enableEnable caching

◆ enable_order_by_date()

enable_order_by_date (   $enable = true)

Set whether feed items should be sorted into reverse chronological order

Paramètres
bool$enableSort as reverse chronological order.

Référencé par set_stupidly_fast().

◆ encode_instead_of_strip()

encode_instead_of_strip (   $enable = true)

Références sanitize().

◆ error()

error ( )

Get the error message for the occured error

Renvoie
string|array Error message, or array of messages for multifeeds

Références $error.

Référencé par fetch_data(), et init().

◆ fetch_data()

fetch_data ( $cache)
protected

Fetch the data via SimplePie_File

If the data is already cached, attempt to fetch it from there instead

Paramètres
SimplePie_Cache | false$cacheCache handler, or false to not load from the cache
Renvoie
array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type

Références $cache, $file, elseif, error(), force_feed(), force_fsockopen(), init(), null, set_feed_url(), SIMPLEPIE_BUILD, SIMPLEPIE_FILE_SOURCE_REMOTE, et SIMPLEPIE_NAME.

Référencé par init().

◆ force_feed()

force_feed (   $enable = false)

Force the given data/URL to be treated as a feed

This tells SimplePie to ignore the content-type provided by the server. Be careful when using this option, as it will also disable autodiscovery.

Depuis
1.1
Paramètres
bool$enableForce the given data/URL to be treated as a feed

Référencé par fetch_data().

◆ force_fsockopen()

force_fsockopen (   $enable = false)

Force SimplePie to use fsockopen() instead of cURL

Depuis
1.0 Beta 3
Paramètres
bool$enableForce fsockopen() to be used

Référencé par fetch_data().

◆ get_all_discovered_feeds()

get_all_discovered_feeds ( )

Références $all_discovered_feeds.

◆ get_author()

get_author (   $key = 0)

Get an author for the feed

Depuis
1.1
Paramètres
int$keyThe author that you want to return. Remember that arrays begin with 0, not 1
Renvoie
SimplePie_Author|null

Références $key, get_authors(), et null.

◆ get_authors()

get_authors ( )

Get all authors for the feed

Uses <atom:author>, <author>, <dc:creator> or <itunes:author>

Depuis
1.1
Renvoie
array|null List of {
Voir également
SimplePie_Author} objects

Références $author, $name, $uri, $url, get_base(), get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_IRI, SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, et SIMPLEPIE_NAMESPACE_ITUNES.

Référencé par get_author().

◆ get_base()

get_base (   $element = array())

Get the base URL value from the feed

Uses <xml:base> if available, otherwise uses the first link in the feed, or failing that, the URL of the feed itself.

Voir également
get_link
subscribe_url
Paramètres
array$element
Renvoie
string

Références elseif, get_link(), get_type(), null, SIMPLEPIE_TYPE_RSS_SYNDICATION, et subscribe_url().

Référencé par get_authors(), get_contributors(), get_copyright(), get_description(), get_image_link(), get_image_url(), get_links(), et get_title().

◆ get_categories()

get_categories ( )

Get all categories for the feed

Uses <atom:category>, <category> or <dc:subject>

Depuis
Unknown
Renvoie
array|null List of {
Voir également
SimplePie_Category} objects

Références $category, $label, get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, et SIMPLEPIE_NAMESPACE_RSS_20.

Référencé par get_category().

◆ get_category()

get_category (   $key = 0)

Get a category for the feed

Depuis
Unknown
Paramètres
int$keyThe category that you want to return. Remember that arrays begin with 0, not 1
Renvoie
SimplePie_Category|null

Références $key, get_categories(), et null.

◆ get_channel_tags()

get_channel_tags (   $namespace,
  $tag 
)

Get data for an channel-level element

This method allows you to get access to ANY element/attribute in the channel/header section of the feed.

See {

Voir également
SimplePie::get_feed_tags()} for a description of the return value
Depuis
1.0
Voir également
http://simplepie.org/wiki/faq/supported_xml_namespaces
Paramètres
string$namespaceThe URL of the XML namespace of the elements you're trying to access
string$tagTag name
Renvoie
array

Références $return, $type, get_feed_tags(), get_type(), null, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, SIMPLEPIE_NAMESPACE_RSS_20, SIMPLEPIE_TYPE_ATOM_ALL, SIMPLEPIE_TYPE_RSS_090, SIMPLEPIE_TYPE_RSS_10, et SIMPLEPIE_TYPE_RSS_SYNDICATION.

Référencé par get_authors(), get_categories(), get_contributors(), get_copyright(), get_description(), get_image_tags(), get_image_url(), get_items(), get_language(), get_latitude(), get_links(), get_longitude(), et get_title().

◆ get_contributor()

get_contributor (   $key = 0)

Get a contributor for the feed

Depuis
1.1
Paramètres
int$keyThe contrbutor that you want to return. Remember that arrays begin with 0, not 1
Renvoie
SimplePie_Author|null

Références $key, get_contributors(), et null.

◆ get_contributors()

get_contributors ( )

Get all contributors for the feed

Uses <atom:contributor>

Depuis
1.1
Renvoie
array|null List of {
Voir également
SimplePie_Author} objects

Références $name, $uri, $url, get_base(), get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_IRI, SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_03, et SIMPLEPIE_NAMESPACE_ATOM_10.

Référencé par get_contributor().

◆ get_copyright()

get_copyright ( )

Get the copyright info for the feed

Uses <atom:rights>, <atom:copyright> or <dc:rights>

Depuis
1.0 (previously called get_feed_copyright() since 0.8)
Renvoie
string|null

Références $return, elseif, get_base(), get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_description()

get_description ( )

Get the content for the item

Uses <atom:subtitle>, <atom:tagline>, <description>, <dc:description>, <itunes:summary> or <itunes:subtitle>

Depuis
1.0 (previously called get_feed_description() since 0.8)
Renvoie
string|null

Références $return, elseif, get_base(), get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_HTML, SIMPLEPIE_CONSTRUCT_MAYBE_HTML, SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, SIMPLEPIE_NAMESPACE_ITUNES, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_encoding()

get_encoding ( )

Get the character encoding used for output

Depuis
Preview Release
Renvoie
string

Références sanitize().

Référencé par handle_content_type().

◆ get_favicon()

get_favicon ( )

Get the favicon for the current feed

Obsolète:
Use your own favicon handling instead

Références $url, get_link(), et null.

◆ get_feed_tags()

get_feed_tags (   $namespace,
  $tag 
)

Get data for an feed-level element

This method allows you to get access to ANY element/attribute that is a sub-element of the opening feed tag.

The return value is an indexed array of elements matching the given namespace and tag name. Each element has attribs, data and child subkeys. For attribs and child, these contain namespace subkeys. attribs then has one level of associative name => value data (where value is a string) after the namespace. child has tag-indexed keys after the namespace, each member of which is an indexed array matching this same format.

For example:

// This is probably a bad example because we already support
// <media:content> natively, but it shows you how to parse through
// the nodes.
$group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group');
$content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'];
$file = $content[0]['attribs']['']['url'];
echo $file;
Depuis
1.0
Voir également
http://simplepie.org/wiki/faq/supported_xml_namespaces
Paramètres
string$namespaceThe URL of the XML namespace of the elements you're trying to access
string$tagTag name
Renvoie
array

Références $type, get_type(), null, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_RDF, SIMPLEPIE_NAMESPACE_RSS_20, SIMPLEPIE_TYPE_ATOM_03, SIMPLEPIE_TYPE_ATOM_10, SIMPLEPIE_TYPE_RSS_RDF, et SIMPLEPIE_TYPE_RSS_SYNDICATION.

Référencé par get_channel_tags(), get_image_tags(), et get_items().

◆ get_image_height()

get_image_height ( )

Get the feed logo's height

RSS 2.0 feeds are allowed to have a "feed logo" height.

Uses <image><height> or defaults to 31.0 if no height is specified and the feed is an RSS 2.0 feed.

Renvoie
int|float|null

Références $return, elseif, get_image_tags(), get_type(), null, SIMPLEPIE_NAMESPACE_RSS_20, et SIMPLEPIE_TYPE_RSS_SYNDICATION.

◆ get_image_link()

get_image_link ( )

Get the feed logo's link

RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" link. This points to a human-readable page that the image should link to.

Uses <itunes:image>, <atom:logo>, <atom:icon>, <image><title> or <image><dc:title>

Renvoie
string|null

Références $return, elseif, get_base(), get_image_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_IRI, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_image_tags()

get_image_tags (   $namespace,
  $tag 
)

Get data for an channel-level element

This method allows you to get access to ANY element/attribute in the image/logo section of the feed.

See {

Voir également
SimplePie::get_feed_tags()} for a description of the return value
Depuis
1.0
Voir également
http://simplepie.org/wiki/faq/supported_xml_namespaces
Paramètres
string$namespaceThe URL of the XML namespace of the elements you're trying to access
string$tagTag name
Renvoie
array

Références $image, $type, get_channel_tags(), get_feed_tags(), get_type(), null, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, SIMPLEPIE_NAMESPACE_RSS_20, SIMPLEPIE_TYPE_RSS_090, SIMPLEPIE_TYPE_RSS_10, et SIMPLEPIE_TYPE_RSS_SYNDICATION.

Référencé par get_image_height(), get_image_link(), get_image_title(), get_image_url(), et get_image_width().

◆ get_image_title()

get_image_title ( )

Get the feed logo's title

RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" title.

Uses <image><title> or <image><dc:title>

Renvoie
string|null

Références $return, elseif, get_image_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_image_url()

get_image_url ( )

Get the feed logo's URL

RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to have a "feed logo" URL. This points directly to the image itself.

Uses <itunes:image>, <atom:logo>, <atom:icon>, <image><title> or <image><dc:title>

Renvoie
string|null

Références $return, elseif, get_base(), get_channel_tags(), get_image_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_IRI, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_ITUNES, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_image_width()

get_image_width ( )

Get the feed logo's link

RSS 2.0 feeds are allowed to have a "feed logo" width.

Uses <image><width> or defaults to 88.0 if no width is specified and the feed is an RSS 2.0 feed.

Renvoie
int|float|null

Références $return, elseif, get_image_tags(), get_type(), null, SIMPLEPIE_NAMESPACE_RSS_20, et SIMPLEPIE_TYPE_RSS_SYNDICATION.

◆ get_item()

get_item (   $key = 0)

Get a single item from the feed

This is better suited for for() loops, whereas {

Voir également
get_items()} is better suited for foreach() loops.
get_item_quantity()
Depuis
Beta 2
Paramètres
int$keyThe item that you want to return. Remember that arrays begin with 0, not 1
Renvoie
SimplePie_Item|null

Références $items, $key, get_items(), et null.

◆ get_item_quantity()

get_item_quantity (   $max = 0)

Get the number of items in the feed

This is well-suited for for() loops with {

Voir également
get_item()}
Paramètres
int$maxMaximum value to return. 0 for no limit
Renvoie
int Number of items in the feed

Références get_items().

◆ get_items()

get_items (   $start = 0,
  $end = 0 
)

Get all items from the feed

This is better suited for for() loops, whereas {

Voir également
get_items()} is better suited for foreach() loops.
get_item_quantity
Depuis
Beta 2
Paramètres
int$startIndex to start at
int$endNumber of items to return. 0 for all items after $start
Renvoie
array|null List of {
Voir également
SimplePie_Item} objects

Références $item, $items, $key, $start, get_channel_tags(), get_feed_tags(), merge_items(), null, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

Référencé par get_item(), et get_item_quantity().

◆ get_language()

get_language ( )

Get the language for the feed

Uses <language>, <dc:language>, or

Depuis
1.0 (previously called get_feed_language() since 0.8)
Renvoie
string|null

Références $return, elseif, get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_TEXT, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_DC_10, SIMPLEPIE_NAMESPACE_DC_11, SIMPLEPIE_NAMESPACE_RDF, et SIMPLEPIE_NAMESPACE_RSS_20.

◆ get_latitude()

get_latitude ( )

Get the latitude coordinates for the item

Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications

Uses <geo:lat> or <georss:point>

Depuis
1.0 W3C WGS84 Basic Geo http://www.georss.org/ GeoRSS string|null

Références $return, elseif, get_channel_tags(), null, SIMPLEPIE_NAMESPACE_GEORSS, et SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO.

◆ get_link()

get_link (   $key = 0,
  $rel = 'alternate' 
)

Get a single link for the feed

Depuis
1.0 (previously called get_feed_link since Preview Release, get_feed_permalink() since 0.8)
Paramètres
int$keyThe link that you want to return. Remember that arrays begin with 0, not 1
string$relThe relationship of the link to return
Renvoie
string|null Link URL

Références $key, $rel, get_links(), et null.

Référencé par get_base(), get_favicon(), et get_permalink().

◆ get_links()

get_links (   $rel = 'alternate')

Get all links for the feed

Uses <atom:link> or <link>

Depuis
Beta 2
Paramètres
string$relThe relationship of links to return
Renvoie
array|null Links found for the feed (strings)

Références $key, $link, $rel, elseif, get_base(), get_channel_tags(), null, sanitize(), SIMPLEPIE_CONSTRUCT_IRI, SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, et SIMPLEPIE_NAMESPACE_RSS_20.

Référencé par get_link().

◆ get_longitude()

get_longitude ( )

Get the longitude coordinates for the feed

Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications

Uses <geo:long>, <geo:lon> or <georss:point>

Depuis
1.0 W3C WGS84 Basic Geo http://www.georss.org/ GeoRSS string|null

Références $return, elseif, get_channel_tags(), null, SIMPLEPIE_NAMESPACE_GEORSS, et SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO.

◆ get_permalink()

get_permalink ( )

Get the permalink for the item

Returns the first link available with a relationship of "alternate". Identical to {

Voir également
get_link()} with key 0
get_link
Depuis
1.0 (previously called get_feed_link since Preview Release, get_feed_permalink() since 0.8)

Références get_link().

◆ get_raw_data()

get_raw_data ( )

Get the raw XML

This is the same as the old $feed->enable_xml_dump(true), but returns the data instead of printing it.

Renvoie
string|boolean Raw XML data, false if the cache is used

Références $raw_data.

◆ get_registry()

& get_registry ( )

Get the class registry

Use this to override SimplePie's default classes

Voir également
SimplePie_Registry
Renvoie
SimplePie_Registry

Références $registry.

◆ get_title()

get_title ( )

◆ get_type()

get_type ( )

Get the type of the feed

This returns a SIMPLEPIE_TYPE_* constant, which can be tested against using bitwise operators

Depuis
0.8 (usage changed to using constants in 1.0)
Voir également
SIMPLEPIE_TYPE_NONE Unknown.
SIMPLEPIE_TYPE_RSS_090 RSS 0.90.
SIMPLEPIE_TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape).
SIMPLEPIE_TYPE_RSS_091_USERLAND RSS 0.91 (Userland).
SIMPLEPIE_TYPE_RSS_091 RSS 0.91.
SIMPLEPIE_TYPE_RSS_092 RSS 0.92.
SIMPLEPIE_TYPE_RSS_093 RSS 0.93.
SIMPLEPIE_TYPE_RSS_094 RSS 0.94.
SIMPLEPIE_TYPE_RSS_10 RSS 1.0.
SIMPLEPIE_TYPE_RSS_20 RSS 2.0.x.
SIMPLEPIE_TYPE_RSS_RDF RDF-based RSS.
SIMPLEPIE_TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format).
SIMPLEPIE_TYPE_RSS_ALL Any version of RSS.
SIMPLEPIE_TYPE_ATOM_03 Atom 0.3.
SIMPLEPIE_TYPE_ATOM_10 Atom 1.0.
SIMPLEPIE_TYPE_ATOM_ALL Any version of Atom.
SIMPLEPIE_TYPE_ALL Any known/supported feed type.
Renvoie
int SIMPLEPIE_TYPE_* constant

Références elseif, SIMPLEPIE_NAMESPACE_ATOM_03, SIMPLEPIE_NAMESPACE_ATOM_10, SIMPLEPIE_NAMESPACE_RDF, SIMPLEPIE_NAMESPACE_RSS_090, SIMPLEPIE_NAMESPACE_RSS_10, SIMPLEPIE_NAMESPACE_RSS_20, SIMPLEPIE_TYPE_ALL, SIMPLEPIE_TYPE_ATOM_03, SIMPLEPIE_TYPE_ATOM_10, SIMPLEPIE_TYPE_NONE, SIMPLEPIE_TYPE_RSS_090, SIMPLEPIE_TYPE_RSS_091, SIMPLEPIE_TYPE_RSS_091_NETSCAPE, SIMPLEPIE_TYPE_RSS_091_USERLAND, SIMPLEPIE_TYPE_RSS_092, SIMPLEPIE_TYPE_RSS_093, SIMPLEPIE_TYPE_RSS_094, SIMPLEPIE_TYPE_RSS_10, SIMPLEPIE_TYPE_RSS_20, et SIMPLEPIE_TYPE_RSS_ALL.

Référencé par get_base(), get_channel_tags(), get_feed_tags(), get_image_height(), get_image_tags(), get_image_width(), et init().

◆ handle_content_type()

handle_content_type (   $mime = 'text/html')

Send the content-type header with correct encoding

This method ensures that the SimplePie-enabled page is being served with the correct mime-type and character encoding HTTP headers (character encoding determined by the {

Voir également
set_output_encoding} config option).

This won't work properly if any content or whitespace has already been sent to the browser, because it relies on PHP's header() function, and these are the circumstances under which the function works.

Because it's setting these settings for the entire page (as is the nature of HTTP headers), this should only be used once per page (again, at the top).

Paramètres
string$mimeMIME type to serve the page as

Références get_encoding().

◆ init()

init ( )

Initialize the feed object

This is what makes everything happen. Period. This is where all of the configuration options get processed, feeds are fetched, cached, and parsed, and all of that other good stuff.

Renvoie
boolean True if successful, false otherwise

Références $cache, $force_fsockopen, $i, $input_encoding, $timeout, $url, $useragent, elseif, error(), fetch_data(), get_type(), null, sanitize(), SIMPLEPIE_BUILD, et SIMPLEPIE_TYPE_NONE.

Référencé par __construct(), et fetch_data().

◆ merge_items()

static merge_items (   $urls,
  $start = 0,
  $end = 0,
  $limit = 0 
)
static

Merge items from several feeds into one

If you're merging multiple feeds together, they need to all have dates for the items or else SimplePie will refuse to sort them.

array $urls List of SimplePie feed objects to merge int $start Starting item int $end Number of items to return int $limit Maximum number of items per feed array

Références $item, $items, $limit, $start, $urls, et null.

Référencé par get_items().

◆ remove_div()

remove_div (   $enable = true)

Références sanitize().

Référencé par set_stupidly_fast().

◆ sanitize()

sanitize (   $data,
  $type,
  $base = '' 
)

Sanitize feed data

private

Voir également
SimplePie_Sanitize::sanitize()
Paramètres
string$dataData to sanitize
int$typeOne of the SIMPLEPIE_CONSTRUCT_* constants
string$baseBase URL to resolve URLs against
Renvoie
string Sanitized data

Références $base, $data, et $type.

Référencé par __construct(), encode_instead_of_strip(), get_authors(), get_categories(), get_contributors(), get_copyright(), get_description(), get_encoding(), get_image_link(), get_image_title(), get_image_url(), get_language(), get_links(), get_title(), init(), remove_div(), set_image_handler(), set_output_encoding(), set_url_replacements(), strip_attributes(), strip_comments(), strip_htmltags(), et subscribe_url().

◆ set_author_class()

set_author_class (   $class = 'SimplePie_Author')

Set which class SimplePie uses for handling author data

Références $class.

◆ set_autodiscovery_cache_duration()

set_autodiscovery_cache_duration (   $seconds = 604800)

Set the length of time (in seconds) that the autodiscovered feed URL will be cached

Paramètres
int$secondsThe autodiscovered feed URL cache duration.

◆ set_autodiscovery_level()

set_autodiscovery_level (   $level = SIMPLEPIE_LOCATOR_ALL)

Set how much feed autodiscovery to do

Voir également
SIMPLEPIE_LOCATOR_NONE
SIMPLEPIE_LOCATOR_AUTODISCOVERY
SIMPLEPIE_LOCATOR_LOCAL_EXTENSION
SIMPLEPIE_LOCATOR_LOCAL_BODY
SIMPLEPIE_LOCATOR_REMOTE_EXTENSION
SIMPLEPIE_LOCATOR_REMOTE_BODY
SIMPLEPIE_LOCATOR_ALL
Paramètres
int$levelFeed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)

◆ set_cache_class()

set_cache_class (   $class = 'SimplePie_Cache')

◆ set_cache_duration()

set_cache_duration (   $seconds = 3600)

Set the length of time (in seconds) that the contents of a feed will be cached

Paramètres
int$secondsThe feed content cache duration

Référencé par __construct().

◆ set_cache_location()

set_cache_location (   $location = './cache')

Set the file system location where the cached files should be stored

Paramètres
string$locationThe file system location.

Références $location.

Référencé par __construct().

◆ set_cache_name_function()

set_cache_name_function (   $function = 'md5')

Set callback function to create cache filename with

Paramètres
mixed$functionCallback function

Références $function.

◆ set_caption_class()

set_caption_class (   $class = 'SimplePie_Caption')

Set which class SimplePie uses for <media:text> captions

Références $class.

◆ set_category_class()

set_category_class (   $class = 'SimplePie_Category')

Set which class SimplePie uses for handling category data

Références $class.

◆ set_content_type_sniffer_class()

set_content_type_sniffer_class (   $class = 'SimplePie_Content_Type_Sniffer')

Set which class SimplePie uses for content-type sniffing

Références $class.

◆ set_copyright_class()

set_copyright_class (   $class = 'SimplePie_Copyright')

Set which class SimplePie uses for <media:copyright>

Références $class.

◆ set_credit_class()

set_credit_class (   $class = 'SimplePie_Credit')

Set which class SimplePie uses for <media:credit>

Références $class.

◆ set_enclosure_class()

set_enclosure_class (   $class = 'SimplePie_Enclosure')

Set which class SimplePie uses for feed enclosures

Références $class.

◆ set_favicon_handler()

set_favicon_handler (   $page = false,
  $qs = 'i' 
)

Set the favicon handler

Obsolète:
Use your own favicon handling instead

◆ set_feed_url()

set_feed_url (   $url)

Set the URL of the feed you want to parse

This allows you to enter the URL of the feed you want to parse, or the website you want to try to use auto-discovery on. This takes priority over any set raw data.

You can set multiple feeds to mash together by passing an array instead of a string for the $url. Remember that with each additional feed comes additional processing and resources.

Depuis
1.0 Preview Release
Voir également
set_raw_data()
Paramètres
string | array$urlThis is the URL (or array of URLs) that you want to parse.

Références $url, et $value.

Référencé par __construct(), et fetch_data().

◆ set_file()

set_file ( $file)

Set an instance of {

Voir également
SimplePie_File} to use as a feed
Paramètres
SimplePie_File&$file
Renvoie
bool True on success, false on failure

Références $file.

◆ set_file_class()

set_file_class (   $class = 'SimplePie_File')

Set which class SimplePie uses for remote file fetching

Références $class.

◆ set_image_handler()

set_image_handler (   $page = false,
  $qs = 'i' 
)

Set the handler to enable the display of cached images.

Paramètres
str$pageWeb-accessible path to the handler_image.php file.
str$qsThe query string that the value should be passed to.

Références sanitize().

Référencé par set_stupidly_fast().

◆ set_input_encoding()

set_input_encoding (   $encoding = false)

Set the character encoding used to parse the feed

This overrides the encoding reported by the feed, however it will fall back to the normal encoding detection if the override fails

Paramètres
string$encodingCharacter encoding

◆ set_item_class()

set_item_class (   $class = 'SimplePie_Item')

Set which class SimplePie uses for handling feed items

Références $class.

◆ set_item_limit()

set_item_limit (   $limit = 0)

Set the limit for items returned per-feed with multifeeds

Paramètres
integer$limitThe maximum number of items to return.

Références $limit.

◆ set_locator_class()

set_locator_class (   $class = 'SimplePie_Locator')

Set which class SimplePie uses for auto-discovery

Références $class.

◆ set_max_checked_feeds()

set_max_checked_feeds (   $max = 10)

Set maximum number of feeds to check with autodiscovery

Paramètres
int$maxMaximum number of feeds to check

◆ set_output_encoding()

set_output_encoding (   $encoding = 'UTF-8')

Set the output encoding

Allows you to override SimplePie's output to match that of your webpage. This is useful for times when your webpages are not being served as UTF-8. This setting will be obeyed by {

Voir également
handle_content_type()}, and is similar to {
set_input_encoding()}.

It should be noted, however, that not all character encodings can support all characters. If your page is being served as ISO-8859-1 and you try to display a Japanese feed, you'll likely see garbled characters. Because of this, it is highly recommended to ensure that your webpages are served as UTF-8.

The number of supported character encodings depends on whether your web host supports mbstring, iconv, or both. See http://simplepie.org/wiki/faq/Supported_Character_Encodings for more information.

Paramètres
string$encoding

Références sanitize().

◆ set_parser_class()

set_parser_class (   $class = 'SimplePie_Parser')

Set which class SimplePie uses for XML parsing

Références $class.

◆ set_rating_class()

set_rating_class (   $class = 'SimplePie_Rating')

Set which class SimplePie uses for <media:rating>

Références $class.

◆ set_raw_data()

set_raw_data (   $data)

Set the raw XML data to parse

Allows you to use a string of RSS/Atom data instead of a remote feed.

If you have a feed available as a string in PHP, you can tell SimplePie to parse that data string instead of a remote feed. Any set feed URL takes precedence.

Depuis
1.0 Beta 3
Paramètres
string$dataRSS or Atom data as a string.
Voir également
set_feed_url()

Références $data.

◆ set_restriction_class()

set_restriction_class (   $class = 'SimplePie_Restriction')

Set which class SimplePie uses for <media:restriction>

Références $class.

◆ set_sanitize_class()

set_sanitize_class (   $class = 'SimplePie_Sanitize')

Set which class SimplePie uses for data sanitization

Références $class.

◆ set_source_class()

set_source_class (   $class = 'SimplePie_Source')

Set which class SimplePie uses item sources

Références $class.

◆ set_stupidly_fast()

set_stupidly_fast (   $set = false)

Set options to make SP as fast as possible

Forgoes a substantial amount of data sanitization in favor of speed. This turns SimplePie into a dumb parser of feeds.

Paramètres
bool$setWhether to set them or not

Références enable_order_by_date(), remove_div(), set_image_handler(), strip_attributes(), strip_comments(), et strip_htmltags().

◆ set_timeout()

set_timeout (   $timeout = 10)

Set the the default timeout for fetching remote feeds

This allows you to change the maximum time the feed's server to respond and send the feed back.

Depuis
1.0 Beta 3
Paramètres
int$timeoutThe maximum number of seconds to spend waiting to retrieve a feed.

Références $timeout.

◆ set_url_replacements()

set_url_replacements (   $element_attribute = null)

Set element/attribute key/value pairs of HTML attributes containing URLs that need to be resolved relative to the feed

Defaults to |a|, |area|, |blockquote|

Références sanitize().

◆ set_useragent()

set_useragent (   $ua = SIMPLEPIE_USERAGENT)

#- Set the user agent string

Paramètres
string$uaNew user agent string.

◆ sort_items()

static sort_items (   $a,
  $b 
)
static

Sorting callback for items

private

Paramètres
SimplePie$a
SimplePie$b
Renvoie
boolean

Références $b.

◆ strip_attributes()

array Stores the default attributes to be stripped by strip_attributes (   $attribs = '')
Voir également
SimplePie::strip_attributes() private

Références $attribs, $strip_attributes, et sanitize().

Référencé par set_stupidly_fast().

◆ strip_comments()

strip_comments (   $strip = false)

Références sanitize().

Référencé par set_stupidly_fast().

◆ strip_htmltags()

array Stores the default tags to be stripped by strip_htmltags (   $tags = '',
  $encode = null 
)
Voir également
SimplePie::strip_htmltags() private

Références $strip_htmltags, null, et sanitize().

Référencé par set_stupidly_fast().

◆ subscribe_url()

subscribe_url ( )

Get the URL for the feed

May or may not be different from the URL passed to {

Voir également
set_feed_url()}, depending on whether auto-discovery was used.
Depuis
Preview Release (previously called get_feed_url() since SimplePie 0.8.)
Renvoie
string|null

Références null, sanitize(), et SIMPLEPIE_CONSTRUCT_IRI.

Référencé par get_base().

Documentation des champs

◆ $all_discovered_feeds

$all_discovered_feeds = array()

Référencé par get_all_discovered_feeds().

◆ $autodiscovery

$autodiscovery = SIMPLEPIE_LOCATOR_ALL

◆ $autodiscovery_cache_duration

$autodiscovery_cache_duration = 604800

◆ $cache

$cache = true

Référencé par fetch_data(), et init().

◆ $cache_duration

$cache_duration = 3600

◆ $cache_location

$cache_location = './cache'

◆ $cache_name_function

$cache_name_function = 'md5'

◆ $config_settings

$config_settings = null

◆ $data

$data = array()

Référencé par sanitize(), et set_raw_data().

◆ $error

Référencé par error().

◆ $feed_url

$feed_url

◆ $file

$file

Référencé par __call(), fetch_data(), et set_file().

◆ $force_feed

◆ $force_fsockopen

Référencé par init().

◆ $image_handler

$image_handler = ''

◆ $input_encoding

$input_encoding = false

Référencé par init().

◆ $item_limit

$item_limit = 0

◆ $max_checked_feeds

$max_checked_feeds = 10

◆ $multifeed_objects

$multifeed_objects = array()

◆ $multifeed_url

$multifeed_url = array()

◆ $order_by_date

$order_by_date = true

◆ $raw_data

$raw_data

Référencé par get_raw_data().

◆ $registry

$registry

Référencé par get_registry().

◆ $sanitize

◆ $strip_attributes

$strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc')

Référencé par strip_attributes().

◆ $strip_htmltags

$strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style')

Référencé par strip_htmltags().

◆ $timeout

$timeout = 10

Référencé par init(), et set_timeout().

◆ $useragent

$useragent = SIMPLEPIE_USERAGENT

Référencé par init().


La documentation de cette classe a été générée à partir du fichier suivant :