FcPhp Cache
Package to manage Cache Index and crypto content using Sodium PHP (optional)

How to install
Composer:
$ composer require 00f100/fcphp-cache
or add in composer.json
{
"require": {
"00f100/fcphp-cache": "*"
}
}
How to use
<?php
use FcPhp\Cache\Facades\CacheFacade;
use FcPhp\Crypto\Crypto;
$cache = CacheFacade::getInstance(string|array $cacheRepository, string $nonce = null, string $pathKeys = null);
$redis = [
'host' => '127.0.0.1',
'port' => '6379',
'password' => null,
'timeout' => 100,
];
$cache = CacheFacade::getInstance($redis);
$redis = [
'host' => '127.0.0.1',
'port' => '6379',
'password' => null,
'timeout' => 100,
];
$cache = CacheFacade::getInstance($redis, Crypto::getNonce(), 'path/to/keys');
$cache = CacheFacade::getInstance('path/to/cache');
$cache = CacheFacade::getInstance('path/to/cache', Crypto::getNonce(), 'path/to/keys');
$cache->set(string $key, $content, int $ttl) :ICache
$cache->has(string $key) :bool
$cache->get(string $key)
$cache->delete(string $key) :void
$cache->clean() :ICache