public function acquire($expires)
    {
        // do not lock if expiry time is 0
        if ($expires <= 0) {
            return true;
        }

        $k = $this->getName();
        $this->lock = $this->factory->createLock($k, $expires);

        return $this->lock->acquire();
    }
public function acquire($expires)
    {
        // do not lock if expiry time is 0
        if ($expires <= 0) {
            return true;
        }

        $k = $this->getName();
        $this->lock = $this->factory->createLock($k, $expires);

        return $this->lock->acquire();
    }
public function acquire ( $ expires ) { // do not lock if expiry time is 0 if ( $ expires <= 0 ) { return true ; } $ k = $ this -> getName ( ) ; $ this -> lock = $ this -> factory -> createLock ( $ k , $ expires ) ; return $ this -> lock -> acquire ( ) ; }
Attempts to acquire the global lock for this job.

@param int $expires time in seconds after which the lock expires

@return bool
Attempts to acquire the global lock for this job .