PHP code example of lyoshenka / php-simple-lock
1. Go to this page and download the library: Download lyoshenka/php-simple-lock 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/ */
lyoshenka / php-simple-lock example snippets
use SimpleLock\Lock;
$lock = Lock::acquire('lockname');
if ($lock)
{
// lock acquired. protected code goes here.
Lock::release($lock);
}
Lock::setLockDir('/path/to/lock/dir');
composer