1. Go to this page and download the library: Download soupmix/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/ */
soupmix / cache example snippets
$rConfig = ['host'=> "127.0.0.1"];
$handler = new Redis();
$handler->connect(
$rConfig['host']
);
$cache = new Soupmix\Cache\RedisCache($handler);
$config = [
'bucket' => 'test',
'hosts' => ['127.0.0.1'],
;
$handler = new Memcached($config['bucket']);
$handler->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$handler->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
if (!count($handler->getServerList())) {
$hosts = [];
foreach ($config['hosts'] as $host) {
$hosts[] = [$host, 11211];
}
$handler->addServers($hosts);
}
$cache = new Soupmix\Cache\MemcachedCache($handler);