PHP code example of ivacuum / low-level-memcached
1. Go to this page and download the library: Download ivacuum/low-level-memcached 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/ */
ivacuum / low-level-memcached example snippets
use Vacuum\LowLevelMemcached;
$memcached = new LowLevelMemcached('127.0.0.1', 11211);
// Сохранение данных
$memcached->set('cron.last', time());
// Получение данных
$data = $memcached->get('cron.last');
// Удаление данных
$memcached->delete('cron.last');
$memcached->set('async.key', 'data to set');
$memcached->getLater('async.key');
// ...
// Прочие операции
// ...
// Настал момент, когда понадобились данные
$async_data = $memcached->fetch();