getDetails() getDetails() : array Get JSON details for cache item. Returns array — with json details on cache.
setCache() setCache( $path) : $this Set the path to the cache directory. Parameters $path Returns $this
isCacheWritable() isCacheWritable() : $this Check if cache is writable or throw exception. Throws \Exception if cahce folder is not writable. Returns $this
useCache() useCache(boolean $use = true) : $this Decide if the cache should be used or not before trying to download a remote file. Parameters boolean $use true to use the cache and false to ignore cache. Returns $this
save() save() : string Save downloaded resource to cache. Returns string — as path to saved file or false if not saved.
updateCacheDetails() updateCacheDetails() : string Got a 304 and updates cache with new age. Returns string — as path to cached file.
download() download(string $url) : string Download a remote file and keep a cache of downloaded files. Parameters string $url a remote url. Throws \Exception when status code does not match 200 or 304. Returns string — as path to downloaded file or false if failed.
loadCacheDetails() loadCacheDetails() : $this Get the path to the cached image file if the cache is valid. Returns $this
getCachedSource() getCachedSource() : string Get the path to the cached image file if the cache is valid. Returns string — as the path ot the image file or false if no cache.