Download the PHP package voku/simple-cache without Composer
On this page you can find all versions of the php package voku/simple-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download voku/simple-cache
More information about voku/simple-cache
Files in voku/simple-cache
Package simple-cache
Short Description Simple Cache library
License MIT
Homepage https://github.com/voku/simple-cache
Informations about the package simple-cache
:zap: Simple Cache Class
This is a simple Cache Abstraction Layer for PHP >= 7.0 that provides a simple interaction with your cache-server. You can define the Adapter / Serializer in the "constructor" or the class will auto-detect you server-cache in this order:
- Memcached / Memcache
- Redis
- Xcache
- APC / APCu
- OpCache (via PHP-files)
- Static-PHP-Cache
Get "Simple Cache"
You can download it from here, or require it using composer.
Install via "composer require"
Quick Start
Usage
If you have an heavy task e.g. a really-big-loop, then you can also use static-cache. But keep in mind, that this will be stored into PHP (it needs more memory).
PS: By default, the static cache is also used by >= 10 cache hits. But you can configure this behavior via $cache->setStaticCacheHitCounter(INT).
No-Cache for the admin or a specific ip-address
If you use the parameter "$checkForUser" (=== true) in the constructor, then the cache isn't used for the admin-session.
-> You can also overwrite the check for the user, if you add a global function named "checkForDev()".
Overwrite the auto-connection option
You can overwrite the cache auto-detect via "CacheAdapterAutoManager" and the "$cacheAdapterManagerForAutoConnect" option in the "Cache"-constructor. Additional you can also activate the "$cacheAdapterManagerForAutoConnectOverwrite" option in the "Cache"-constructor, so that you can implement your own cache auto-detect logic.
Support
For support and donations please visit Github | Issues | PayPal | Patreon.
For status updates and release announcements please visit Releases | Twitter | Patreon.
For professional support please contact me.
Thanks
- Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to Travis CI for being the most awesome, easiest continous integration tool out there!
- Thanks to StyleCI for the simple but powerfull code style check.
- Thanks to PHPStan && Psalm for relly great Static analysis tools and for discover bugs in the code!