apix / simple-cache
The PSR-16 extension to Apix-Cache.
Installs: 16 336
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^5.3.2|^7.0
- apix/cache: ^1.3
- psr/simple-cache: ^1.0
Requires (Dev)
- phpunit/phpunit: ^4.0|^5.0
- satooshi/php-coveralls: ~0.7.1
Provides
This package is auto-updated.
Last update: 2024-10-29 04:47:43 UTC
README
Apix-SimpleCache provides PSR-16 to Apix-Cache permitting easy caching and invalidation...
- Fully unit-tested and compliant with PSR-1, PSR-2, PSR-4 and PSR-16.
- Continuously integrated with PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3
and HHVM.
⇄ Pull requests and ★ Stars are always welcome. For bugs and feature request, please create an issue.
Basic usage
use Apix\SimpleCache; $client = new \Redis(); #$client = new \PDO('sqlite:...'); // Any supported client object e.g. Memcached, MongoClient, ... #$client = new Cache\Files($options); // or one that implements Apix\Cache\Adapter #$client = 'apc'; // or an adapter name (string) e.g. "APC", "Runtime" #$client = new MyArrayObject(); // or even a plain array() or \ArrayObject. $cache = SimpleCache\Factory::getPool($client); // without tagging support #$cache = SimpleCache\Factory::getTaggablePool($client); // with tagging if ( !$cache->has('wibble_id') ) { $data = compute_slow_and_expensive_stuff(); $cache->set('wibble_id', $data); } return $cache->get('wibble_id');
Installation
This project adheres to Semantic Versioning and can be installed using composer:
$ composer require apix/simple-cache:1.0.*
All notable changes to this project are documented in its CHANGELOG.
License
This work is licensed under the New BSD license -- see the LICENSE for the full details.
Copyright (c) 2010-2017 Franck Cassedanne