aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/simplepie/simplepie/src/Cache/Base.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/simplepie/simplepie/src/Cache/Base.php')
-rw-r--r--vendor/simplepie/simplepie/src/Cache/Base.php80
1 files changed, 71 insertions, 9 deletions
diff --git a/vendor/simplepie/simplepie/src/Cache/Base.php b/vendor/simplepie/simplepie/src/Cache/Base.php
index c097906ff..08304648b 100644
--- a/vendor/simplepie/simplepie/src/Cache/Base.php
+++ b/vendor/simplepie/simplepie/src/Cache/Base.php
@@ -5,10 +5,7 @@
* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
- * Please note: This file is automatically generated by a build script. The
- * full original source is always available from http://simplepie.org/
- *
- * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
+ * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
@@ -46,10 +43,75 @@
namespace SimplePie\Cache;
-interface_exists('SimplePie_Cache_Base');
+/**
+ * Base for cache objects
+ *
+ * Classes to be used with {@see \SimplePie\Cache::register()} are expected
+ * to implement this interface.
+ *
+ * @package SimplePie
+ * @subpackage Caching
+ */
+interface Base
+{
+ /**
+ * Feed cache type
+ *
+ * @var string
+ */
+ const TYPE_FEED = 'spc';
+
+ /**
+ * Image cache type
+ *
+ * @var string
+ */
+ const TYPE_IMAGE = 'spi';
-if (\false) {
- interface Base extends \SimplePie_Cache_Base
- {
- }
+ /**
+ * Create a new cache object
+ *
+ * @param string $location Location string (from SimplePie::$cache_location)
+ * @param string $name Unique ID for the cache
+ * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
+ */
+ public function __construct($location, $name, $type);
+
+ /**
+ * Save data to the cache
+ *
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data);
+
+ /**
+ * Retrieve the data saved to the cache
+ *
+ * @return array Data for SimplePie::$data
+ */
+ public function load();
+
+ /**
+ * Retrieve the last modified time for the cache
+ *
+ * @return int Timestamp
+ */
+ public function mtime();
+
+ /**
+ * Set the last modified time to the current time
+ *
+ * @return bool Success status
+ */
+ public function touch();
+
+ /**
+ * Remove the cache
+ *
+ * @return bool Success status
+ */
+ public function unlink();
}
+
+class_alias('SimplePie\Cache\Base', 'SimplePie_Cache_Base');