PHP code example of komw / silex-layered-memcache
1. Go to this page and download the library: Download komw/silex-layered-memcache 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/ */
komw / silex-layered-memcache example snippets
$app->register(new LayeredMemcache(),
[
'memcache.server' => [array(
['127.0.0.1', 11211],
]
);
//OR
$app->register(new LayeredMemcache());
$data = $app['layered_memcache']->get('key_name', function () {
//gettting data from DB,etc.
return $data;
}
);