sweetchuck / cache-backend-arangodb
PSR6 compatible cache backend implementation with ArangoDB
1.x-dev
2022-12-31 17:26 UTC
Requires
- php: >=7.4
- cache/adapter-common: ^1.1
- psr/cache: ^1.0
- psr/simple-cache: ^1.0
- triagens/arangodb: dev-devel#7254837dafd9aeea3a4006b453283aff9c3507fc
Requires (Dev)
- ext-json: *
- cache/integration-tests: ^0.17
- consolidation/robo: ^3.0
- nuvoleweb/robo-config: ^2.0
- phpunit/phpunit: ^9.0
- psr/container: ^1.0
- squizlabs/php_codesniffer: ^3.5
- sweetchuck/git-hooks: 2.x-dev
- sweetchuck/robo-git: 2.x-dev
- sweetchuck/robo-phpcs: 2.x-dev
- sweetchuck/robo-phpmd: 2.x-dev
- sweetchuck/robo-phpunit: 2.x-dev
- symfony/phpunit-bridge: ^5.0
- vimeo/psalm: ^4.3
Suggests
- ext-igbinary: One of the data serializer uses the 'igbinary' extension. https://pecl.php.net/package/igbinary
- ext-json: One of the data serializer uses the 'json' extension.
- ext-msgpack: One of the data serializer uses the 'msgpack' extension. https://pecl.php.net/package/msgpack
This package is auto-updated.
Last update: 2023-03-01 00:43:38 UTC
README
Supported interfaces
\Psr\SimpleCache\CacheInterface
\Psr\Cache\CacheItemPoolInterface
\Cache\TagInterop\TaggableCacheItemPoolInterface
Example
<?php declare(strict_types = 1); use Sweetchuck\CacheBackend\ArangoDb\CacheItemPool; use ArangoDBClient\ConnectionOptions; require_once __DIR__ . '/vendor/autoload.php'; $pool = new CacheItemPool(); $pool ->setConnectionOptions([ ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529', ConnectionOptions::OPTION_AUTH_USER => 'me', ConnectionOptions::OPTION_AUTH_PASSWD => 'my_password', ConnectionOptions::OPTION_DATABASE => 'my_project_01', ]) ->setCollectionName('cache_dummy'); $item_my01 = $pool ->getItem('my01') ->setTags(['my_tag_01']) ->set([ 'foo' => 'bar-' . date('H-i-s'), ]); $pool->save($item_my01); $item_my02 = $pool ->getItem('my01') ->setTags(['my_tag_02']) ->set([ 'foo' => 'bar-' . date('H-i-s'), ]); $pool->save($item_my02); $pool->invalidateTags(['my_tag_01']);