PHP code example of nona-creative / pid-manager
1. Go to this page and download the library: Download nona-creative/pid-manager 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/ */
nona-creative / pid-manager example snippets
php
$pidManager = new \Nona\PidManager('test.lock', './');
$pidManager->withLock(function() {
// Do your processing here
// ...
});
php
$pidManager = new \Nona\PidManager('test.lock', './');
if (!$pidManager->isLocked()) {
try {
$pidManager->lock();
// Do your processing here
// ...
} finally {
$pidManager->unlock();
}
}