PHP code example of loganhenson / cronlock

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

    

loganhenson / cronlock example snippets


// 5 minutes after job, it will release the lock
$CronLock = new CronLock(new Client());

// a nice key might be `__CLASS__ . __METHOD__`
$CronLock->cron('some unique key for the job', function () {
	//do some cron stuff
});