src/Handlers/PidFileHandler.php
/**
     * Remove's the UUID of the actual import process from the PID file.
     *
     * @return void
     * @throws \Exception Is thrown, if the PID can not be removed
     */
Remove's the UUID of the actual import process from the PID file.
@return void
@throws \Exception Is thrown, if the PID can not be removed
Remove ' s the UUID of the actual import process from the PID file . @return void @throws \ Exception Is thrown if the PID can not be removed
public function unlock()
    {
        try {
            if ($this->pid === $this->getSerial() && is_resource($this->fh)) {
                $this->removeLineFromFile($this->pid, $this->fh);
                flock($this->fh, LOCK_UN);
                fclose($this->fh);
                if (filesize($filename = $this->getPidFilename()) === 0) {
                    unlink($filename);
                }
                $this->pid = null;
                $this->fh = null;
            }
        } catch (FileNotFoundException $fnfe) {
            $this->getSystemLogger()->notice(sprintf('PID file %s doesn\'t exist', $this->getPidFilename()));
        } catch (LineNotFoundException $lnfe) {
            $this->getSystemLogger()->notice(sprintf('PID %s is can not be found in PID file %s', $this->pid, $this->getPidFilename()));
        } catch (\Exception $e) {
            throw new \Exception(sprintf('Can\'t remove PID %s from PID file %s', $this->pid, $this->getPidFilename()), null, $e);
        }
    }
public function unlock ( ) { try { if ( $ this -> pid === $ this -> getSerial ( ) && is_resource ( $ this -> fh ) ) { $ this -> removeLineFromFile ( $ this -> pid , $ this -> fh ) ; flock ( $ this -> fh , LOCK_UN ) ; fclose ( $ this -> fh ) ; if ( filesize ( $ filename = $ this -> getPidFilename ( ) ) === 0 ) { unlink ( $ filename ) ; } $ this -> pid = null ; $ this -> fh = null ; } } catch ( FileNotFoundException $ fnfe ) { $ this -> getSystemLogger ( ) -> notice ( sprintf ( 'PID file %s doesn\'t exist' , $ this -> getPidFilename ( ) ) ) ; } catch ( LineNotFoundException $ lnfe ) { $ this -> getSystemLogger ( ) -> notice ( sprintf ( 'PID %s is can not be found in PID file %s' , $ this -> pid , $ this -> getPidFilename ( ) ) ) ; } catch ( \ Exception $ e ) { throw new \ Exception ( sprintf ( 'Can\'t remove PID %s from PID file %s' , $ this -> pid , $ this -> getPidFilename ( ) ) , null , $ e ) ; } }
Remove's the UUID of the actual import process from the PID file.
Remove ' s the UUID of the actual import process from the PID file .
// remove the PID from the PID file if set // remove the PID from the file // finally unlock/close the PID file // if the PID file is empty, delete the file // reset resource