PHP code example of wudege / sil
1. Go to this page and download the library: Download wudege/sil 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/ */
wudege / sil example snippets
$config = array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 5,
);
$client = new \Predis\Client($config);
$lock = new \Sil\RedisSingleInstanceLock($client);
$lock->acquireLock('lock-example', sha1(uniqid(mt_rand(), true)), 3000);