mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-06-29 16:47:40 +02:00
caches: Refactor the API (#1060)
- For consistency, functions should always return null on non-existing data. - WordPressPluginUpdateBridge appears to have used its own cache instance in the past. Obviously not used anymore. - Since $key can be anything, the cache implementation must ensure to assign the related data reliably; most commonly by serializing and hashing the key in an appropriate way. - Even though the default path for storage is perfectly fine, some people may want to use a different location. This is an example how a cache implementation is responsible for its requirements.
This commit is contained in:
parent
3b8f3da09d
commit
21d3bf3b60
8 changed files with 121 additions and 84 deletions
|
@ -86,9 +86,9 @@ class DisplayAction extends ActionAbstract {
|
|||
|
||||
// Initialize cache
|
||||
$cache = Cache::create(Configuration::getConfig('cache', 'type'));
|
||||
$cache->setPath(PATH_CACHE);
|
||||
$cache->setScope('');
|
||||
$cache->purgeCache(86400); // 24 hours
|
||||
$cache->setParameters($cache_params);
|
||||
$cache->setKey($cache_params);
|
||||
|
||||
$items = array();
|
||||
$infos = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue