Download the PHP package juanchosl/simplecache without Composer
On this page you can find all versions of the php package juanchosl/simplecache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juanchosl/simplecache
More information about juanchosl/simplecache
Files in juanchosl/simplecache
Package simplecache
Short Description A small collection of read/write for multiples cache systems using PSR-16
License MIT
Homepage https://github.com/JuanchoSL/SimpleCache
Informations about the package simplecache
SimpleCache
Description
A small collection of read/write functions for multiples cache systems
Install
Performance
From faster to slower
- Process: It's only valid for current request execution
- Session: Only valid for a current user session
- Memcached: If Memcached service is available and Memcached library is installed
- Redis: If Redis service is available and Redis library is installed
- Memcache: If Memcached service is available and Memcache library is installed
- File: The most compatible system, file into filesystem, but slower
How use it
Use directly one of the available libs
For create a cache instance
For write a cache index
Set into $cache_key
the $value
, valid for $ttl
seconds or default TTL if you don not pass a value
For read a cache index
Read from cache the contents of $cache_key
and return his value or $default
if it not exists or it is not valid
For delete a cache index
Delete from cache the value with $cache_key
For write multiple cache indexes
Set into $cache_key
the $values
, an iterable containing a list of $cache_key => $value
pairs, valid for $ttl
seconds or default TTL if you don not pass a value
For read multiple cache indexes
Read from cache the contents of $cache_keys
and return a list of $key => $value
pairs. Missed keys has the $default
value
For delete a cache index
Delete from cache the values from the $cache_keys
list
For replace a cache index
Replace into cache the value with $cache_key
with the $new_value
without change his expiration time
For change the time to live of cache index
Change the expiration time of $cache_key
with the new one passed as $new_ttl
For increment a cache index numeric value
Increments the value into $cache_key
adding $numeric_increment
to his value. If not exists it is created.
For decrement a cache index numeric value
Decrements the value into $cache_key
subtracting $numeric_decrement
to his value. If not exists it is created.
For check if the cache contains a $cache_key
Check if key exists, is not recommended, because can be return true and just another script can remove it
For clear all cache indexes
Remove all data from cache
Use the provided adapter for use with compatibility with PSR-16 Simple-Cache
Create a cache instance
After create a Cache Instance, you can use it with the provided PsrSimpleCacheAdapter in order to work conform the PSR-16 https://www.php-fig.org/psr/psr-16/
All versions of simplecache with dependencies
psr/log Version 3.0.*
psr/simple-cache Version 3.0.*
psr/cache Version 3.0.*
juanchosl/validators Version 1.0.*
juanchosl/exceptions Version 1.0.*