Download the PHP package mattmezza/cacheasy without Composer
On this page you can find all versions of the php package mattmezza/cacheasy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mattmezza/cacheasy
More information about mattmezza/cacheasy
Files in mattmezza/cacheasy
Download mattmezza/cacheasy
More information about mattmezza/cacheasy
Files in mattmezza/cacheasy
Vendor mattmezza
Package cacheasy
Short Description I hate slow APIs, I cache things on disk.
License MIT
Package cacheasy
Short Description I hate slow APIs, I cache things on disk.
License MIT
Please rate this library. Is it a good library?
Informations about the package cacheasy
cacheasy
I hate slow APIs, I cache things on disk.
Install
composer require mattmezza/cacheasy
Usage
With string responses:
With JSON responses:
API
cacheString($key, $string) : string
: caches a string with keycacheJson($key, $array) : array
: caches an array to json with keyhitString($key) : string
: tries to resume from cache a string with keyhitJson($key) : array
: tries to resume from cache a json with keyisCached($key) : bool
: checks if key is cached on disk and if it is not expiredgetJson($key, $provider = null, bool $forceFresh = false) : array
: returnshitJson(...)
if key is cached, calls provider otherwise. Throws exception if $provider is null and $key is not cached. If $forceFresh is set totrue
skips isCached check and calls the provider (ultimately caching the data).getString($key, $provider = null, bool $forceFresh = false) : string
: returnshitString(...)
if key is cached, calls provider otherwise. Throws exception if $provider is null and $key is not cached. If $forceFresh is set totrue
skips isCached check and calls the provider (ultimately caching the data).invalidate($key) : void
: deletes the cached resourceinvalidateAll() : void
: deletes all the cached resources
Exceptions
MissingProviderException
: when get..(...)
is called for a non cached resource and no provider is passed, or when, even if the resource is cached, the method is invoked with null provider and with true
force fresh values.
NotCachedException
: when you wanna hit the cache but the resource is not cached yet.
Development
git clone https://github.com/mattmezza/cacheasy.git
cd cacheasy
composer test
Matteo Merola [email protected]
All versions of cacheasy with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.1
The package mattmezza/cacheasy contains the following files
Loading the files please wait ....