Download the PHP package phossa/phossa-cache without Composer
On this page you can find all versions of the php package phossa/phossa-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phossa-cache
phossa-cache [ABANDONED]
See new lib at phoole/cache Introduction
Phossa-cache is a PSR-6 compliant caching library. It supports various drivers and useful features like bypass, encrypt, stampede protection, garbage collect, taggable item etc.
More information about PSR-6 and PSR-6 Meta
Installation
Install via the composer
utility.
or add the following lines to your composer.json
Features
-
Fully PSR-6 compliant. Maybe the most feature-rich PSR-6 caching package you will find at github at this time.
-
Support all serializable PHP datatypes.
-
Extensions:
-
Bypass: If sees a trigger in URL (e.g. '?nocache=true'), bypass the cache.
-
Stampede: Whenever cached object's lifetime is less than a configurable time, by certain percentage, the cache will return false on 'isHit()' which will trigger re-generation of the object.
-
Encrypt: A simple extension to encrypt the serialized content
-
GarbageCollect: A simple extension to auto-clean the cache pool.
-
Taggable: Item is taggable and can be cleared by tag.
- DistributeMiss: Even out the spikes of item misses by alter expiration time a little bit.
-
-
Drivers
- FilesystemDriver
The filesystem driver stores cached item in filesystem. It stores cached items in a md5-filename flat file. Configurable settings are
dir_root
: the base directory for the filesystem cachehash_level
: hashed subdirectory level. default to 2file_pref
: cached item filename prefix-
file_suff
: cached item filename suffix - NullDriver
The blackhole driver. used as fallback driver for all other drivers.
- Fallback driver
User may configure a fallback driver if the desired driver is not ready. The
NullDriver
is the final fallback for all other drivers.- CompositeDriver
The
CompositeDriver
consists of two drivers, the front-end driver and the backend driver. User filters cachable objects by defining atester
callable which will determine which objects stores to both ends or backend only. -
Logging
The phossa-cache supports psr-3 compliant logger. Also provides a
log()
method for logging.Or configure with logger at cache init
-
Error
No exceptions thrown during caching process. So only errors will be used.
-
I18n
Messages are in
Message\Message.php
. I18n is possible. See phossa-shared package for detail. -
Support PHP 5.4+, PHP 7.0, HHVM.
-
PHP7 ready for return type declarations and argument type declarations.
- PSR-1, PSR-2, PSR-3, PSR-4, PSR-6 compliant.
Usage
-
The simple usage
-
Configure the driver
-
Use extensions
or
addExtension()
-
Hierarchal cache support
Directory-style hierarchal structure is supported in
FilesystemDriver
and so other coming drivers.
Dependencies
- PHP >= 5.4.0
- phossa/phossa-shared 1.0.6
- psr/cache 1.*