guardianphp/lock-cache

Cache driver for Lock

dev-master / 0.1.x-dev 2015-06-19 14:51 UTC

This package is not auto-updated.

Last update: 2020-08-11 13:34:20 UTC


README

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

Cache driver for Lock.

Install

Via Composer

$ composer require guardianphp/lock-cache

Usage

Reading all roles from the storage layer per request is a waste of resources. To make things faster, roles and permissions should be cached.

This library provides caching drivers for BeatSwitch Lock.

The usage is simple:

  1. Install one of tedivm/stash and doctrine/cache.
  2. Wrap your existing driver with one of the caching drivers
  3. Done!
use Guardian\Lock\Driver\StashCacheDriver;

$driver = new StashCacheDriver($myDriver);

Caller and Role permissions get cached. Upon update (store/remove) this cache gets cleared.

Testing

$ phpspec run

Security

If you discover any security related issues, please contact us at security@guardianphp.org.

Credits

License

The MIT License (MIT). Please see License File for more information.