PHP code example of aalfiann / event-locker-php
1. Go to this page and download the library: Download aalfiann/event-locker-php 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/ */
aalfiann / event-locker-php example snippets
use aalfiann\EventLocker;
r();
// lock
echo "Waiting...\n";
$locker->lock();
// sleep for 10 seconds
echo "Sleeping...\n";
sleep(10);
echo "Finished!\n";
// unlock
$locker->unlock();
// Example if you want to set identify locker for post.
$locker = new EventLocker('post.lock');
composer