PHP code example of chilimatic / cache-component

1. Go to this page and download the library: Download chilimatic/cache-component 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/ */

    

chilimatic / cache-component example snippets


$cache = Cache::getInstance(['type' => chilimatic\lib\Cache\Engine\Adapter\Memory::class]);

$cache = CacheFactory::make(chilimatic\lib\Cache\Engine\Adapter\Memory::class);

$cache = new chilimatic\lib\Cache\Engine\Adapter\Memory();

$cache = new chilimatic\lib\Cache\Engine\Adapter\Memcached([
    'server_list' => [[
        'host' => '127.0.0.1',
        'port' => 11211,
        'weight' => 1
    ]],
    'options' => [ // the options are per instance not per connection!
        Memcached::OPT_HASH => Memcached::HASH_MURMUR
    ]
]);

$cache = new chilimatic\lib\Cache\Engine\Adapter\APCU();
 
$cache = chilimatic\lib\Cache\Engine\Adapter\Memory();

var_dump($cache->listEntries());