superbalist / json-guard-cached
A json-guard decorator to enable schema caching
Installs: 17 797
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 1
Open Issues: 1
Requires
- league/json-guard: *
- psr/cache: 1.0.1.
Requires (Dev)
- cache/array-adapter: ^0.4.2
- cache/redis-adapter: ^0.4.2
- phpunit/phpunit: 4.*
- squizlabs/php_codesniffer: ~2.3
This package is auto-updated.
Last update: 2022-07-13 19:33:57 UTC
README
A json-guard decorator to enable schema caching. Works with any PSR-6 cache implementation.
This decorator is experimental until it proves to be worth using.
Install
Via Composer
$ composer require yuloh/json-guard-cached
Usage
use Cache\Adapter\Redis\RedisCachePool; use League\JsonGuard\Dereferencer; use League\JsonGuard\Cached\CachedDereferencer; $client = new Redis(); $client->connect('127.0.0.1', 6379); $cache = new RedisCachePool($client); $deref = new Dereferencer(); $deref = new CachedDereferencer($cache, $deref); $schema = $deref->dereference('file://my-schema.json');
Testing
$ composer test
License
The MIT License (MIT). Please see License File for more information.