Lines Matching full:cache

15      * Get the data stored in the cache file e.g. thumbnail encoded data
17 * @param $cache_id string the id of the cache
21 $cache = new cache_externalembed($cache_id);
22 return json_decode($cache->retrieveCache(), true);
26 * Updates the E tag of the cache file to be the current time
27 * @param $cache_id string the id of the cache
30 $cache = new cache_externalembed($cache_id);
31 $cache->storeETag(md5(time()));
35 * Return true if the cache is still fresh, otherwise return false
36 * @param $cache_id string the cache id
37 * @param $time // the expiry time of the cache
41 $cache = new cache_externalembed($cache_id);
43 if($cache->checkETag($time)) return true;
50 * Return the thumbnail data to be cached or checked with the existing cache.
57 …rl, 'thumbnail' => $thumbnail); //return thumbnail data to be cached or checked with existing cache
61 * Generate a new cache object and store the new data
62 * @param $video_id string the id of the cache
63 * @param $cache_data mixed the data to store in the cache
64 * @return cache_externalembed the cache object
68 … return $this->newCache($video_id, $cache_data, $timestamp); //create cache file and return object
72 * Public function generates new cache object
73 * Stores the data within a json encoded cache file
74 * @param $cache_id string the unique identifier for the cache
75 * @param null $data The data to be stored in the cache
76 * @param null $timestamp When the cache was created
77 * @return cache_externalembed the cache object
80 $cache = new cache_externalembed($cache_id);
81 $cache->storeCache(json_encode($data));
82 $cache->storeETag($timestamp);
83 return $cache;
87 * Generate a new cache object and store the new data
88 * @param $playlist_id string the id of the cache
89 * @param $video_ids mixed the data stored in the cache
90 * @return cache_externalembed the new cache object
95 //store the latest video from the playlist and return the cache object
156 … * Public function to remove the video_id cache file from the depends array and the page metadata
158 * @param $page_cache mixed the page cache used in the PARSER CACHE USE event
161 $cache = new cache_externalembed($video_id);
162 if(($key = array_search($cache->cache, $page_cache->depends['files'])) !== false) {
184 * Get the file path of the cache file associated with the ID
185 * @param $cache_id string The id of the cache file
186 * @return string The file path for the cache file
189 $cache = new cache_externalembed($cache_id);
190 return $cache->cache;
195 * Class that handles cache files, file locking and cache expiry
197 class cache_externalembed extends \dokuwiki\Cache\Cache {
203 $this->e_tag = substr($this->cache, 0, -15) . '.etag';
222 * Public function that returns true if the cache (Etag) is still fresh
230 … if(!($this->_etag_time = @filemtime($this->e_tag))) return false; //check if cache is still there
231 if((time() - $this->_etag_time) > $expireTime) return false; //Cache has expired