Edit File by line
/home/zeestwma/richards.../wp-inclu.../SimplePi.../src
File: SimplePie.php
*/
[500] Fix | Delete
public $force_cache_fallback = false;
[501] Fix | Delete
[502] Fix | Delete
/**
[503] Fix | Delete
* @var int Cache duration (in seconds)
[504] Fix | Delete
* @see SimplePie::set_cache_duration()
[505] Fix | Delete
* @access private
[506] Fix | Delete
*/
[507] Fix | Delete
public $cache_duration = 3600;
[508] Fix | Delete
[509] Fix | Delete
/**
[510] Fix | Delete
* @var int Auto-discovery cache duration (in seconds)
[511] Fix | Delete
* @see SimplePie::set_autodiscovery_cache_duration()
[512] Fix | Delete
* @access private
[513] Fix | Delete
*/
[514] Fix | Delete
public $autodiscovery_cache_duration = 604800; // 7 Days.
[515] Fix | Delete
[516] Fix | Delete
/**
[517] Fix | Delete
* @var string Cache location (relative to executing script)
[518] Fix | Delete
* @see SimplePie::set_cache_location()
[519] Fix | Delete
* @access private
[520] Fix | Delete
*/
[521] Fix | Delete
public $cache_location = './cache';
[522] Fix | Delete
[523] Fix | Delete
/**
[524] Fix | Delete
* @var string&(callable(string): string) Function that creates the cache filename
[525] Fix | Delete
* @see SimplePie::set_cache_name_function()
[526] Fix | Delete
* @access private
[527] Fix | Delete
*/
[528] Fix | Delete
public $cache_name_function = 'md5';
[529] Fix | Delete
[530] Fix | Delete
/**
[531] Fix | Delete
* @var bool Reorder feed by date descending
[532] Fix | Delete
* @see SimplePie::enable_order_by_date()
[533] Fix | Delete
* @access private
[534] Fix | Delete
*/
[535] Fix | Delete
public $order_by_date = true;
[536] Fix | Delete
[537] Fix | Delete
/**
[538] Fix | Delete
* @var mixed Force input encoding to be set to the follow value
[539] Fix | Delete
* (false, or anything type-cast to false, disables this feature)
[540] Fix | Delete
* @see SimplePie::set_input_encoding()
[541] Fix | Delete
* @access private
[542] Fix | Delete
*/
[543] Fix | Delete
public $input_encoding = false;
[544] Fix | Delete
[545] Fix | Delete
/**
[546] Fix | Delete
* @var self::LOCATOR_* Feed Autodiscovery Level
[547] Fix | Delete
* @see SimplePie::set_autodiscovery_level()
[548] Fix | Delete
* @access private
[549] Fix | Delete
*/
[550] Fix | Delete
public $autodiscovery = self::LOCATOR_ALL;
[551] Fix | Delete
[552] Fix | Delete
/**
[553] Fix | Delete
* Class registry object
[554] Fix | Delete
*
[555] Fix | Delete
* @var Registry
[556] Fix | Delete
*/
[557] Fix | Delete
public $registry;
[558] Fix | Delete
[559] Fix | Delete
/**
[560] Fix | Delete
* @var int Maximum number of feeds to check with autodiscovery
[561] Fix | Delete
* @see SimplePie::set_max_checked_feeds()
[562] Fix | Delete
* @access private
[563] Fix | Delete
*/
[564] Fix | Delete
public $max_checked_feeds = 10;
[565] Fix | Delete
[566] Fix | Delete
/**
[567] Fix | Delete
* @var array<Response>|null All the feeds found during the autodiscovery process
[568] Fix | Delete
* @see SimplePie::get_all_discovered_feeds()
[569] Fix | Delete
* @access private
[570] Fix | Delete
*/
[571] Fix | Delete
public $all_discovered_feeds = [];
[572] Fix | Delete
[573] Fix | Delete
/**
[574] Fix | Delete
* @var string Web-accessible path to the handler_image.php file.
[575] Fix | Delete
* @see SimplePie::set_image_handler()
[576] Fix | Delete
* @access private
[577] Fix | Delete
*/
[578] Fix | Delete
public $image_handler = '';
[579] Fix | Delete
[580] Fix | Delete
/**
[581] Fix | Delete
* @var array<string> Stores the URLs when multiple feeds are being initialized.
[582] Fix | Delete
* @see SimplePie::set_feed_url()
[583] Fix | Delete
* @access private
[584] Fix | Delete
*/
[585] Fix | Delete
public $multifeed_url = [];
[586] Fix | Delete
[587] Fix | Delete
/**
[588] Fix | Delete
* @var array<int, static> Stores SimplePie objects when multiple feeds initialized.
[589] Fix | Delete
* @access private
[590] Fix | Delete
*/
[591] Fix | Delete
public $multifeed_objects = [];
[592] Fix | Delete
[593] Fix | Delete
/**
[594] Fix | Delete
* @var array<mixed> Stores the get_object_vars() array for use with multifeeds.
[595] Fix | Delete
* @see SimplePie::set_feed_url()
[596] Fix | Delete
* @access private
[597] Fix | Delete
*/
[598] Fix | Delete
public $config_settings = null;
[599] Fix | Delete
[600] Fix | Delete
/**
[601] Fix | Delete
* @var int Stores the number of items to return per-feed with multifeeds.
[602] Fix | Delete
* @see SimplePie::set_item_limit()
[603] Fix | Delete
* @access private
[604] Fix | Delete
*/
[605] Fix | Delete
public $item_limit = 0;
[606] Fix | Delete
[607] Fix | Delete
/**
[608] Fix | Delete
* @var bool Stores if last-modified and/or etag headers were sent with the
[609] Fix | Delete
* request when checking a feed.
[610] Fix | Delete
*/
[611] Fix | Delete
public $check_modified = false;
[612] Fix | Delete
[613] Fix | Delete
/**
[614] Fix | Delete
* @var array<string> Stores the default attributes to be stripped by strip_attributes().
[615] Fix | Delete
* @see SimplePie::strip_attributes()
[616] Fix | Delete
* @access private
[617] Fix | Delete
*/
[618] Fix | Delete
public $strip_attributes = ['bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'];
[619] Fix | Delete
[620] Fix | Delete
/**
[621] Fix | Delete
* @var array<string, array<string, string>> Stores the default attributes to add to different tags by add_attributes().
[622] Fix | Delete
* @see SimplePie::add_attributes()
[623] Fix | Delete
* @access private
[624] Fix | Delete
*/
[625] Fix | Delete
public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']];
[626] Fix | Delete
[627] Fix | Delete
/**
[628] Fix | Delete
* @var array<string> Stores the default tags to be stripped by strip_htmltags().
[629] Fix | Delete
* @see SimplePie::strip_htmltags()
[630] Fix | Delete
* @access private
[631] Fix | Delete
*/
[632] Fix | Delete
public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'];
[633] Fix | Delete
[634] Fix | Delete
/**
[635] Fix | Delete
* @var string[]|string Stores the default attributes to be renamed by rename_attributes().
[636] Fix | Delete
* @see SimplePie::rename_attributes()
[637] Fix | Delete
* @access private
[638] Fix | Delete
*/
[639] Fix | Delete
public $rename_attributes = [];
[640] Fix | Delete
[641] Fix | Delete
/**
[642] Fix | Delete
* @var bool Should we throw exceptions, or use the old-style error property?
[643] Fix | Delete
* @access private
[644] Fix | Delete
*/
[645] Fix | Delete
public $enable_exceptions = false;
[646] Fix | Delete
[647] Fix | Delete
/**
[648] Fix | Delete
* @var Client|null
[649] Fix | Delete
*/
[650] Fix | Delete
private $http_client = null;
[651] Fix | Delete
[652] Fix | Delete
/** @var bool Whether HTTP client has been injected */
[653] Fix | Delete
private $http_client_injected = false;
[654] Fix | Delete
[655] Fix | Delete
/**
[656] Fix | Delete
* The SimplePie class contains feed level data and options
[657] Fix | Delete
*
[658] Fix | Delete
* To use SimplePie, create the SimplePie object with no parameters. You can
[659] Fix | Delete
* then set configuration options using the provided methods. After setting
[660] Fix | Delete
* them, you must initialise the feed using $feed->init(). At that point the
[661] Fix | Delete
* object's methods and properties will be available to you.
[662] Fix | Delete
*
[663] Fix | Delete
* Previously, it was possible to pass in the feed URL along with cache
[664] Fix | Delete
* options directly into the constructor. This has been removed as of 1.3 as
[665] Fix | Delete
* it caused a lot of confusion.
[666] Fix | Delete
*
[667] Fix | Delete
* @since 1.0 Preview Release
[668] Fix | Delete
*/
[669] Fix | Delete
public function __construct()
[670] Fix | Delete
{
[671] Fix | Delete
if (version_compare(PHP_VERSION, '7.2', '<')) {
[672] Fix | Delete
exit('Please upgrade to PHP 7.2 or newer.');
[673] Fix | Delete
}
[674] Fix | Delete
[675] Fix | Delete
$this->set_useragent();
[676] Fix | Delete
[677] Fix | Delete
$this->set_cache_namefilter(new CallableNameFilter($this->cache_name_function));
[678] Fix | Delete
[679] Fix | Delete
// Other objects, instances created here so we can set options on them
[680] Fix | Delete
$this->sanitize = new Sanitize();
[681] Fix | Delete
$this->registry = new Registry();
[682] Fix | Delete
[683] Fix | Delete
if (func_num_args() > 0) {
[684] Fix | Delete
trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', \E_USER_DEPRECATED);
[685] Fix | Delete
[686] Fix | Delete
$args = func_get_args();
[687] Fix | Delete
switch (count($args)) {
[688] Fix | Delete
case 3:
[689] Fix | Delete
$this->set_cache_duration($args[2]);
[690] Fix | Delete
// no break
[691] Fix | Delete
case 2:
[692] Fix | Delete
$this->set_cache_location($args[1]);
[693] Fix | Delete
// no break
[694] Fix | Delete
case 1:
[695] Fix | Delete
$this->set_feed_url($args[0]);
[696] Fix | Delete
$this->init();
[697] Fix | Delete
}
[698] Fix | Delete
}
[699] Fix | Delete
}
[700] Fix | Delete
[701] Fix | Delete
/**
[702] Fix | Delete
* Used for converting object to a string
[703] Fix | Delete
* @return string
[704] Fix | Delete
*/
[705] Fix | Delete
public function __toString()
[706] Fix | Delete
{
[707] Fix | Delete
return md5(serialize($this->data));
[708] Fix | Delete
}
[709] Fix | Delete
[710] Fix | Delete
/**
[711] Fix | Delete
* Remove items that link back to this before destroying this object
[712] Fix | Delete
* @return void
[713] Fix | Delete
*/
[714] Fix | Delete
public function __destruct()
[715] Fix | Delete
{
[716] Fix | Delete
if (!gc_enabled()) {
[717] Fix | Delete
if (!empty($this->data['items'])) {
[718] Fix | Delete
foreach ($this->data['items'] as $item) {
[719] Fix | Delete
$item->__destruct();
[720] Fix | Delete
}
[721] Fix | Delete
unset($item, $this->data['items']);
[722] Fix | Delete
}
[723] Fix | Delete
if (!empty($this->data['ordered_items'])) {
[724] Fix | Delete
foreach ($this->data['ordered_items'] as $item) {
[725] Fix | Delete
$item->__destruct();
[726] Fix | Delete
}
[727] Fix | Delete
unset($item, $this->data['ordered_items']);
[728] Fix | Delete
}
[729] Fix | Delete
}
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
/**
[733] Fix | Delete
* Force the given data/URL to be treated as a feed
[734] Fix | Delete
*
[735] Fix | Delete
* This tells SimplePie to ignore the content-type provided by the server.
[736] Fix | Delete
* Be careful when using this option, as it will also disable autodiscovery.
[737] Fix | Delete
*
[738] Fix | Delete
* @since 1.1
[739] Fix | Delete
* @param bool $enable Force the given data/URL to be treated as a feed
[740] Fix | Delete
* @return void
[741] Fix | Delete
*/
[742] Fix | Delete
public function force_feed(bool $enable = false)
[743] Fix | Delete
{
[744] Fix | Delete
$this->force_feed = $enable;
[745] Fix | Delete
}
[746] Fix | Delete
[747] Fix | Delete
/**
[748] Fix | Delete
* Set the URL of the feed you want to parse
[749] Fix | Delete
*
[750] Fix | Delete
* This allows you to enter the URL of the feed you want to parse, or the
[751] Fix | Delete
* website you want to try to use auto-discovery on. This takes priority
[752] Fix | Delete
* over any set raw data.
[753] Fix | Delete
*
[754] Fix | Delete
* Deprecated since 1.9.0: You can set multiple feeds to mash together by passing an array instead
[755] Fix | Delete
* of a string for the $url. Remember that with each additional feed comes
[756] Fix | Delete
* additional processing and resources.
[757] Fix | Delete
*
[758] Fix | Delete
* @since 1.0 Preview Release
[759] Fix | Delete
* @see set_raw_data()
[760] Fix | Delete
* @param string|string[] $url This is the URL (or (deprecated) array of URLs) that you want to parse.
[761] Fix | Delete
* @return void
[762] Fix | Delete
*/
[763] Fix | Delete
public function set_feed_url($url)
[764] Fix | Delete
{
[765] Fix | Delete
$this->multifeed_url = [];
[766] Fix | Delete
if (is_array($url)) {
[767] Fix | Delete
trigger_error('Fetching multiple feeds with single SimplePie instance is deprecated since SimplePie 1.9.0, create one SimplePie instance per feed and use SimplePie::merge_items to get a single list of items.', \E_USER_DEPRECATED);
[768] Fix | Delete
foreach ($url as $value) {
[769] Fix | Delete
$this->multifeed_url[] = $this->registry->call(Misc::class, 'fix_protocol', [$value, 1]);
[770] Fix | Delete
}
[771] Fix | Delete
} else {
[772] Fix | Delete
$this->feed_url = $this->registry->call(Misc::class, 'fix_protocol', [$url, 1]);
[773] Fix | Delete
$this->permanent_url = $this->feed_url;
[774] Fix | Delete
}
[775] Fix | Delete
}
[776] Fix | Delete
[777] Fix | Delete
/**
[778] Fix | Delete
* Set an instance of {@see File} to use as a feed
[779] Fix | Delete
*
[780] Fix | Delete
* @deprecated since SimplePie 1.9.0, use \SimplePie\SimplePie::set_http_client() or \SimplePie\SimplePie::set_raw_data() instead.
[781] Fix | Delete
*
[782] Fix | Delete
* @param File &$file
[783] Fix | Delete
* @return bool True on success, false on failure
[784] Fix | Delete
*/
[785] Fix | Delete
public function set_file(File &$file)
[786] Fix | Delete
{
[787] Fix | Delete
// trigger_error(sprintf('SimplePie\SimplePie::set_file() is deprecated since SimplePie 1.9.0, please use "SimplePie\SimplePie::set_http_client()" or "SimplePie\SimplePie::set_raw_data()" instead.'), \E_USER_DEPRECATED);
[788] Fix | Delete
[789] Fix | Delete
$this->feed_url = $file->get_final_requested_uri();
[790] Fix | Delete
$this->permanent_url = $this->feed_url;
[791] Fix | Delete
$this->file = &$file;
[792] Fix | Delete
[793] Fix | Delete
return true;
[794] Fix | Delete
}
[795] Fix | Delete
[796] Fix | Delete
/**
[797] Fix | Delete
* Set the raw XML data to parse
[798] Fix | Delete
*
[799] Fix | Delete
* Allows you to use a string of RSS/Atom data instead of a remote feed.
[800] Fix | Delete
*
[801] Fix | Delete
* If you have a feed available as a string in PHP, you can tell SimplePie
[802] Fix | Delete
* to parse that data string instead of a remote feed. Any set feed URL
[803] Fix | Delete
* takes precedence.
[804] Fix | Delete
*
[805] Fix | Delete
* @since 1.0 Beta 3
[806] Fix | Delete
* @param string $data RSS or Atom data as a string.
[807] Fix | Delete
* @see set_feed_url()
[808] Fix | Delete
* @return void
[809] Fix | Delete
*/
[810] Fix | Delete
public function set_raw_data(string $data)
[811] Fix | Delete
{
[812] Fix | Delete
$this->raw_data = $data;
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
/**
[816] Fix | Delete
* Set a PSR-18 client and PSR-17 factories
[817] Fix | Delete
*
[818] Fix | Delete
* Allows you to use your own HTTP client implementations.
[819] Fix | Delete
* This will become required with SimplePie 2.0.0.
[820] Fix | Delete
*/
[821] Fix | Delete
final public function set_http_client(
[822] Fix | Delete
ClientInterface $http_client,
[823] Fix | Delete
RequestFactoryInterface $request_factory,
[824] Fix | Delete
UriFactoryInterface $uri_factory
[825] Fix | Delete
): void {
[826] Fix | Delete
$this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory);
[827] Fix | Delete
}
[828] Fix | Delete
[829] Fix | Delete
/**
[830] Fix | Delete
* Set the default timeout for fetching remote feeds
[831] Fix | Delete
*
[832] Fix | Delete
* This allows you to change the maximum time the feed's server to respond
[833] Fix | Delete
* and send the feed back.
[834] Fix | Delete
*
[835] Fix | Delete
* @since 1.0 Beta 3
[836] Fix | Delete
* @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed.
[837] Fix | Delete
* @return void
[838] Fix | Delete
*/
[839] Fix | Delete
public function set_timeout(int $timeout = 10)
[840] Fix | Delete
{
[841] Fix | Delete
if ($this->http_client_injected) {
[842] Fix | Delete
throw new SimplePieException(sprintf(
[843] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure timeout in your HTTP client instead.',
[844] Fix | Delete
__METHOD__,
[845] Fix | Delete
self::class
[846] Fix | Delete
));
[847] Fix | Delete
}
[848] Fix | Delete
[849] Fix | Delete
$this->timeout = (int) $timeout;
[850] Fix | Delete
[851] Fix | Delete
// Reset a possible existing FileClient,
[852] Fix | Delete
// so a new client with the changed value will be created
[853] Fix | Delete
if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
[854] Fix | Delete
$this->http_client = null;
[855] Fix | Delete
} elseif (is_object($this->http_client)) {
[856] Fix | Delete
// Trigger notice if a PSR-18 client was set
[857] Fix | Delete
trigger_error(sprintf(
[858] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the timeout in your HTTP client instead.',
[859] Fix | Delete
__METHOD__,
[860] Fix | Delete
get_class($this)
[861] Fix | Delete
), \E_USER_NOTICE);
[862] Fix | Delete
}
[863] Fix | Delete
}
[864] Fix | Delete
[865] Fix | Delete
/**
[866] Fix | Delete
* Set custom curl options
[867] Fix | Delete
*
[868] Fix | Delete
* This allows you to change default curl options
[869] Fix | Delete
*
[870] Fix | Delete
* @since 1.0 Beta 3
[871] Fix | Delete
* @param array<int, mixed> $curl_options Curl options to add to default settings
[872] Fix | Delete
* @return void
[873] Fix | Delete
*/
[874] Fix | Delete
public function set_curl_options(array $curl_options = [])
[875] Fix | Delete
{
[876] Fix | Delete
if ($this->http_client_injected) {
[877] Fix | Delete
throw new SimplePieException(sprintf(
[878] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure custom curl options in your HTTP client instead.',
[879] Fix | Delete
__METHOD__,
[880] Fix | Delete
self::class
[881] Fix | Delete
));
[882] Fix | Delete
}
[883] Fix | Delete
[884] Fix | Delete
$this->curl_options = $curl_options;
[885] Fix | Delete
[886] Fix | Delete
// Reset a possible existing FileClient,
[887] Fix | Delete
// so a new client with the changed value will be created
[888] Fix | Delete
if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
[889] Fix | Delete
$this->http_client = null;
[890] Fix | Delete
} elseif (is_object($this->http_client)) {
[891] Fix | Delete
// Trigger notice if a PSR-18 client was set
[892] Fix | Delete
trigger_error(sprintf(
[893] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the curl options in your HTTP client instead.',
[894] Fix | Delete
__METHOD__,
[895] Fix | Delete
get_class($this)
[896] Fix | Delete
), \E_USER_NOTICE);
[897] Fix | Delete
}
[898] Fix | Delete
}
[899] Fix | Delete
[900] Fix | Delete
/**
[901] Fix | Delete
* Force SimplePie to use fsockopen() instead of cURL
[902] Fix | Delete
*
[903] Fix | Delete
* @since 1.0 Beta 3
[904] Fix | Delete
* @param bool $enable Force fsockopen() to be used
[905] Fix | Delete
* @return void
[906] Fix | Delete
*/
[907] Fix | Delete
public function force_fsockopen(bool $enable = false)
[908] Fix | Delete
{
[909] Fix | Delete
if ($this->http_client_injected) {
[910] Fix | Delete
throw new SimplePieException(sprintf(
[911] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.',
[912] Fix | Delete
__METHOD__,
[913] Fix | Delete
self::class
[914] Fix | Delete
));
[915] Fix | Delete
}
[916] Fix | Delete
[917] Fix | Delete
$this->force_fsockopen = $enable;
[918] Fix | Delete
[919] Fix | Delete
// Reset a possible existing FileClient,
[920] Fix | Delete
// so a new client with the changed value will be created
[921] Fix | Delete
if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
[922] Fix | Delete
$this->http_client = null;
[923] Fix | Delete
} elseif (is_object($this->http_client)) {
[924] Fix | Delete
// Trigger notice if a PSR-18 client was set
[925] Fix | Delete
trigger_error(sprintf(
[926] Fix | Delete
'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.',
[927] Fix | Delete
__METHOD__,
[928] Fix | Delete
get_class($this)
[929] Fix | Delete
), \E_USER_NOTICE);
[930] Fix | Delete
}
[931] Fix | Delete
}
[932] Fix | Delete
[933] Fix | Delete
/**
[934] Fix | Delete
* Enable/disable caching in SimplePie.
[935] Fix | Delete
*
[936] Fix | Delete
* This option allows you to disable caching all-together in SimplePie.
[937] Fix | Delete
* However, disabling the cache can lead to longer load times.
[938] Fix | Delete
*
[939] Fix | Delete
* @since 1.0 Preview Release
[940] Fix | Delete
* @param bool $enable Enable caching
[941] Fix | Delete
* @return void
[942] Fix | Delete
*/
[943] Fix | Delete
public function enable_cache(bool $enable = true)
[944] Fix | Delete
{
[945] Fix | Delete
$this->enable_cache = $enable;
[946] Fix | Delete
}
[947] Fix | Delete
[948] Fix | Delete
/**
[949] Fix | Delete
* Set a PSR-16 implementation as cache
[950] Fix | Delete
*
[951] Fix | Delete
* @param CacheInterface $cache The PSR-16 cache implementation
[952] Fix | Delete
*
[953] Fix | Delete
* @return void
[954] Fix | Delete
*/
[955] Fix | Delete
public function set_cache(CacheInterface $cache)
[956] Fix | Delete
{
[957] Fix | Delete
$this->cache = new Psr16($cache);
[958] Fix | Delete
}
[959] Fix | Delete
[960] Fix | Delete
/**
[961] Fix | Delete
* SimplePie to continue to fall back to expired cache, if enabled, when
[962] Fix | Delete
* feed is unavailable.
[963] Fix | Delete
*
[964] Fix | Delete
* This tells SimplePie to ignore any file errors and fall back to cache
[965] Fix | Delete
* instead. This only works if caching is enabled and cached content
[966] Fix | Delete
* still exists.
[967] Fix | Delete
*
[968] Fix | Delete
* @deprecated since SimplePie 1.8.0, expired cache will not be used anymore.
[969] Fix | Delete
*
[970] Fix | Delete
* @param bool $enable Force use of cache on fail.
[971] Fix | Delete
* @return void
[972] Fix | Delete
*/
[973] Fix | Delete
public function force_cache_fallback(bool $enable = false)
[974] Fix | Delete
{
[975] Fix | Delete
// @trigger_error(sprintf('SimplePie\SimplePie::force_cache_fallback() is deprecated since SimplePie 1.8.0, expired cache will not be used anymore.'), \E_USER_DEPRECATED);
[976] Fix | Delete
$this->force_cache_fallback = $enable;
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
/**
[980] Fix | Delete
* Set the length of time (in seconds) that the contents of a feed will be
[981] Fix | Delete
* cached
[982] Fix | Delete
*
[983] Fix | Delete
* @param int $seconds The feed content cache duration
[984] Fix | Delete
* @return void
[985] Fix | Delete
*/
[986] Fix | Delete
public function set_cache_duration(int $seconds = 3600)
[987] Fix | Delete
{
[988] Fix | Delete
$this->cache_duration = $seconds;
[989] Fix | Delete
}
[990] Fix | Delete
[991] Fix | Delete
/**
[992] Fix | Delete
* Set the length of time (in seconds) that the autodiscovered feed URL will
[993] Fix | Delete
* be cached
[994] Fix | Delete
*
[995] Fix | Delete
* @param int $seconds The autodiscovered feed URL cache duration.
[996] Fix | Delete
* @return void
[997] Fix | Delete
*/
[998] Fix | Delete
public function set_autodiscovery_cache_duration(int $seconds = 604800)
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function