PHP code example of fyre / cache

1. Go to this page and download the library: Download fyre/cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fyre / cache example snippets


use Fyre\Cache\CacheManager;

$cacheManager = new CacheManager($container);

$container->singleton(CacheManager::class);

$cacheManager = $container->use(CacheManager::class);

$cacher = $cacheManager->build($options);

$cacheManager->clear();

$cacheManager->disable();

$cacheManager->enable();

$config = $cacheManager->getConfig($key);

$config = $cacheManager->getConfig();

$hasConfig = $cacheManager->hasConfig($key);

$cacheManager->isEnabled();

$isLoaded = $cacheManager->isLoaded($key);

$cacheManager->setConfig($key, $options);

$cacheManager->unload($key);

$cacher = $cacheManager->use($key);

$value = $cacher->decrement($key, $amount);

$deleted = $cacher->delete($key);

$emptied = $cacher->empty();

$value = $cacher->get($key);

$has = $cacher->has($key);

$value = $cacher->increment($key, $amount);

$value = $cacher->remember($key, $callback, $expire);

$saved = $cacher->save($key, $value, $expire);

$size = $cacher->size();

$container->use(Config::class)->set('Cache.file', $options);

$container->use(Config::class)->set('Cache.memcached', $options);

$container->use(Config::class)->set('Cache.redis', $options);