PHP code example of ferrumfist / locker
1. Go to this page and download the library: Download ferrumfist/locker 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/ */
ferrumfist / locker example snippets
$store = new FileStore(__DIR__ . '/stores');
$locker = new Locker($store);
$resource = new LockResource('ResourceName');
if($locker->lock($resource)){
echo "Resource was successfully locked" . PHP_EOL;
} else {
echo "Resource could not be locked" . PHP_EOL;
}