* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
* Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
* @link http://simplepie.org/ SimplePie
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
use InvalidArgumentException;
use Psr\SimpleCache\CacheInterface;
use SimplePie\Cache\Base;
use SimplePie\Cache\BaseDataCache;
use SimplePie\Cache\CallableNameFilter;
use SimplePie\Cache\DataCache;
use SimplePie\Cache\NameFilter;
use SimplePie\Cache\Psr16;
use SimplePie\Content\Type\Sniffer;
public const NAME = 'SimplePie';
public const VERSION = '1.8.0';
public const URL = 'http://simplepie.org';
public const LINKBACK = '<a href="' . self::URL . '" title="' . self::NAME . ' ' . self::VERSION . '">' . self::NAME . '</a>';
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_NONE = 0;
* Feed Link Element Autodiscovery
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_AUTODISCOVERY = 1;
* Local Feed Extension Autodiscovery
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_LOCAL_EXTENSION = 2;
* Local Feed Body Autodiscovery
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_LOCAL_BODY = 4;
* Remote Feed Extension Autodiscovery
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_REMOTE_EXTENSION = 8;
* Remote Feed Body Autodiscovery
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_REMOTE_BODY = 16;
* @see SimplePie::set_autodiscovery_level()
public const LOCATOR_ALL = 31;
public const TYPE_NONE = 0;
public const TYPE_RSS_090 = 1;
public const TYPE_RSS_091_NETSCAPE = 2;
public const TYPE_RSS_091_USERLAND = 4;
* RSS 0.91 (both Netscape and Userland)
public const TYPE_RSS_091 = 6;
public const TYPE_RSS_092 = 8;
public const TYPE_RSS_093 = 16;
public const TYPE_RSS_094 = 32;
public const TYPE_RSS_10 = 64;
public const TYPE_RSS_20 = 128;
public const TYPE_RSS_RDF = 65;
* Non-RDF-based RSS (truly intended as syndication format)
public const TYPE_RSS_SYNDICATION = 190;
public const TYPE_RSS_ALL = 255;
public const TYPE_ATOM_03 = 256;
public const TYPE_ATOM_10 = 512;
public const TYPE_ATOM_ALL = 768;
public const TYPE_ALL = 1023;
public const CONSTRUCT_NONE = 0;
public const CONSTRUCT_TEXT = 1;
public const CONSTRUCT_HTML = 2;
public const CONSTRUCT_XHTML = 4;
* base64-encoded construct
public const CONSTRUCT_BASE64 = 8;
public const CONSTRUCT_IRI = 16;
* A construct that might be HTML
public const CONSTRUCT_MAYBE_HTML = 32;
public const CONSTRUCT_ALL = 63;
public const SAME_CASE = 1;
public const LOWERCASE = 2;
public const UPPERCASE = 4;
* PCRE for HTML attributes
public const PCRE_HTML_ATTRIBUTE = '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*';
* PCRE for XML attributes
public const PCRE_XML_ATTRIBUTE = '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*';
public const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace';
public const NAMESPACE_ATOM_10 = 'http://www.w3.org/2005/Atom';
public const NAMESPACE_ATOM_03 = 'http://purl.org/atom/ns#';
public const NAMESPACE_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
public const NAMESPACE_RSS_090 = 'http://my.netscape.com/rdf/simple/0.9/';
public const NAMESPACE_RSS_10 = 'http://purl.org/rss/1.0/';
* RSS 1.0 Content Module Namespace
public const NAMESPACE_RSS_10_MODULES_CONTENT = 'http://purl.org/rss/1.0/modules/content/';
* (Stupid, I know, but I'm certain it will confuse people less with support.)
public const NAMESPACE_RSS_20 = '';
public const NAMESPACE_DC_10 = 'http://purl.org/dc/elements/1.0/';
public const NAMESPACE_DC_11 = 'http://purl.org/dc/elements/1.1/';
* W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace
public const NAMESPACE_W3C_BASIC_GEO = 'http://www.w3.org/2003/01/geo/wgs84_pos#';
public const NAMESPACE_GEORSS = 'http://www.georss.org/georss';
public const NAMESPACE_MEDIARSS = 'http://search.yahoo.com/mrss/';
* Wrong Media RSS Namespace. Caused by a long-standing typo in the spec.
public const NAMESPACE_MEDIARSS_WRONG = 'http://search.yahoo.com/mrss';
* Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5.
public const NAMESPACE_MEDIARSS_WRONG2 = 'http://video.search.yahoo.com/mrss';
* Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace.
public const NAMESPACE_MEDIARSS_WRONG3 = 'http://video.search.yahoo.com/mrss/';
* Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace.
public const NAMESPACE_MEDIARSS_WRONG4 = 'http://www.rssboard.org/media-rss';
* Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL.
public const NAMESPACE_MEDIARSS_WRONG5 = 'http://www.rssboard.org/media-rss/';
public const NAMESPACE_ITUNES = 'http://www.itunes.com/dtds/podcast-1.0.dtd';
public const NAMESPACE_XHTML = 'http://www.w3.org/1999/xhtml';
* IANA Link Relations Registry
public const IANA_LINK_RELATIONS_REGISTRY = 'http://www.iana.org/assignments/relation/';
public const FILE_SOURCE_NONE = 0;
public const FILE_SOURCE_REMOTE = 1;
public const FILE_SOURCE_LOCAL = 2;
* fsockopen() file source
public const FILE_SOURCE_FSOCKOPEN = 4;
public const FILE_SOURCE_CURL = 8;
* file_get_contents() file source
public const FILE_SOURCE_FILE_GET_CONTENTS = 16;
* @var mixed Error string
* @var int HTTP status code
* @see SimplePie::status_code()
* @var object Instance of \SimplePie\Sanitize (or other class)
* @see SimplePie::set_sanitize_class()
* @var string SimplePie Useragent
* @see SimplePie::set_useragent()
* @see SimplePie::set_feed_url()
* @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently
* @see SimplePie::subscribe_url()
public $permanent_url = null;
* @var object Instance of \SimplePie\File to use as a feed
* @see SimplePie::set_file()
* @var string Raw feed data
* @see SimplePie::set_raw_data()
* @var int Timeout for fetching remote files
* @see SimplePie::set_timeout()
* @var array Custom curl options
* @see SimplePie::set_curl_options()
public $curl_options = [];
* @var bool Forces fsockopen() to be used for remote files instead
* of cURL, even if a new enough version is installed
* @see SimplePie::force_fsockopen()
public $force_fsockopen = false;
* @var bool Force the given data/URL to be treated as a feed no matter what
* @see SimplePie::force_feed()