PHP code example of qqes / flock

1. Go to this page and download the library: Download qqes/flock 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/ */

    

qqes / flock example snippets

 php
y{
  $flock = new Qqes\Flock\Flock(__DIR__);
  $flock->lock('me');
  echo 'I heave lock file' . PHP_EOL;
  sleep(5);
  $flock->unLock('me');
  echo 'I have unlock the file' . PHP_EOL;
}catch(Exception $e){
	echo $e->getMessage();
}