src/SAREhub/Commons/Misc/SimpleSemafor.php
public function lock()
    {
        if (!$this->isLocked()) {
            $file = fopen($this->getFilePath(), 'w');
            if ($file) {
                fwrite($file, getmypid());
                fclose($file);
                return true;
            }
        }
        return false;
    }
public function lock()
    {
        if (!$this->isLocked()) {
            $file = fopen($this->getFilePath(), 'w');
            if ($file) {
                fwrite($file, getmypid());
                fclose($file);
                return true;
            }
        }
        return false;
    }
public function lock ( ) { if ( ! $ this -> isLocked ( ) ) { $ file = fopen ( $ this -> getFilePath ( ) , 'w' ) ; if ( $ file ) { fwrite ( $ file , getmypid ( ) ) ; fclose ( $ file ) ; return true ; } } return false ; }
Try create semafor file
@return bool When successful locked
Try create semafor file