Skip to content

Psr/Cache compatible pool implementation with ArangoDB

Notifications You must be signed in to change notification settings

Sweetchuck/cache-backend-arangodb

Repository files navigation

Psr/Cache compatible pool implementation with ArangoDB

CircleCI codecov

Supported interfaces

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']);

Links

About

Psr/Cache compatible pool implementation with ArangoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published