Download the PHP package comporu/cache without Composer
On this page you can find all versions of the php package comporu/cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download comporu/cache
More information about comporu/cache
Files in comporu/cache
Informations about the package cache
Cache
A simple cache library. Implements different adapters that you can use and change easily by a manager or similar.
Installation
With Composer
It is best installed it through packagist
by including desarrolla2/cache
in your project composer.json require:
Without Composer
You can also download it from [Github] (https://github.com/desarrolla2/Cache), but no autoloader is provided so you'll need to register it with your own PSR-0 compatible autoloader.
Usage
Adapters
Apcu
Use it if you will you have APC cache available in your system.
File
Use it if you will you have dont have other cache system available in your system or if you like to do your code more portable.
Memcache
Use it if you will you have mencache available in your system.
You can config your connection before
Memcached
Is the same like mencache adapter.
Memory
This is the fastest cache type, since the elements are stored in memory. Cache Memory such is very volatile and is removed when the process terminates. Also it is not shared between different processes.
Memory cache have a option "limit", that limit the max items in cache.
Mongo
Use it to store the cache in a Mongo database. Requires the (legacy) mongo extension or the mongodb/mongodb library.
You may pass either a database or collection object to the constructor. If a
database object is passed, the items
collection within that DB is used.
Note that expired cache items aren't automatically deleted. To keep your database clean, you should create a ttl index.
Mysqli
Use it if you will you have mysqlnd available in your system.
NotCache
Use it if you will not implement any cache adapter is an adapter that will serve to fool the test environments.
Predis
Use it if you will you have redis available in your system.
You need to add predis as dependency in your composer file.
other version will have compatibility issues.
If you need to configure your predis client, you will instantiate it and pass it to constructor.
Coming soon
This library implements other adapters as soon as possible, feel free to send new adapters if you think it appropriate.
This can be a list of pending tasks.
- Cleaning cache
- MemcachedAdapter
- Other Adapters
Contact
You can contact with me on @desarrolla2.