Download the PHP package molajo/cache without Composer
On this page you can find all versions of the php package molajo/cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cache
======= Molajo Cache API
Simple, clean cache API for PHP applications to get, [set] (https://github.com/Molajo/Cache/Cache#set), [remove] (https://github.com/Molajo/Cache/Cache#remove), [clear] (https://github.com/Molajo/Cache/Cache#clear), cache.
Cache Handlers available include:
At a glance ...
- Construct a Cache Handler Class.
- Instantiate the Cache Adapter, injecting it with the Cache Handler instance.
- Set cache.
- Get cache.
- Remove cache.
- Clear cache.
Cache API
Common API for Cache operations: get, [set] (https://github.com/Molajo/Cache/Cache#set), [remove] (https://github.com/Molajo/Cache/Cache#remove), [clear] (https://github.com/Molajo/Cache/Cache#clear) methods.
Get
Retrieves a CacheItem object associated with the key. If the value is not found, an exception is thrown.
Parameters
- $key contains the key value for the requested cache
Set
Stores a value as cache for the specified Key value and number of seconds specified.
Parameters
- $key contains the value to use for the cache key
- $value contains the value to be stored as cache
- $ttl "Time to live" which is the number of seconds the cache is considered relevant
Remove
Removes a cache entry associated with the specified Key value.
Parameters
- $key contains the value to use for the cache key
Clear
Remove all cache for this Cache Handler instance.
Parameters
- n/a no parameters are required
Cache Adapter Handlers
Cache Handlers available include:
Apc
APC (Alternative PHP Cache) comes standard with PHP. An APC Cache Handler is available with Molajo Cache and can be used, as follows.
Database
Before using the Database Cache Handler, a table must be available with four columns: id (identity column), key (varchar(255)), value (text) and expiration (integer). When instantiating the Cache Handler, pass in the database connection, the name of the database table for cache, the value for the RDBMS quote and name quote, as shown in this example.
Dummy
The Dummy Cache Handler can be used for testing purpose. It does not really cache data. Use, as follows:
File
The File Cache Handler can be used to turn the local filesystem into a caching device. Use, as follows:
Memcached
The Memcached Cache Handler requires the memcached
PHP extension be loaded and that the Memcached
class exists. For more information, see Memcached in the PHP Manual.
Use, as follows:
Memory
The Memory Cache Handler can be used storing the variables in memory. This can be used with Sessions to create persistence, if desired. Use, as follows:
Redis
The Redis Cache Handler can be used storing the variables in memory. This can be used with Sessions to create persistence, if desired. Use, as follows:
Wincache
The Wincache Cache Handler requires the PHP extension wincache
is loaded and that wincache_ucache_get
is callable.
For more information, see Windows Cache for PHP.. Besides
using the Windows Operating System, there are no other configuration options required to use Wincache
.
xCache
The xCache Handler requires the PHP extension xcache
is loaded and that xcache_get
is callable.
Install using Composer from Packagist
Step 1: Install composer in your project
Step 2: Create a composer.json file in your project root
Step 3: Install via composer
Requirements and Compliance
- PHP framework independent, no dependencies
- Requires PHP 5.4, or above
- Semantic Versioning
- Compliant with:
- PSR-0 and PSR-1 Namespacing
- PSR-2 Coding Standards
- PSR-Cache Interfaces (Still in Draft)
- [phpDocumentor2] (https://github.com/phpDocumentor/phpDocumentor2)
- [phpUnit Testing] (https://github.com/sebastianbergmann/phpunit)
- Author AmyStephen
- [Travis Continuous Improvement] (https://travis-ci.org/profile/Molajo)
- Listed on [Packagist] (http://packagist.org) and installed using [Composer] (http://getcomposer.org/)
- Use github to submit pull requests and features
- Licensed under the MIT License - see the
LICENSE
file for details