public function open()
    {
        if ($this->isOpened()) {
            return;
        }

        if (!file_exists($this->filePath)) {
            throw new \RuntimeException($this->filePath . " does not exist");
        }

        $this->handle = @fopen($this->filePath, self::OPEN_MODE);
        if ($this->handle === false) {
            throw new \RuntimeException("Could not open file for reading: " . $this->filePath);
        }

        if (!$this->lock(LOCK_SH)) {
            $this->close();
            throw new \RuntimeException("Could not aquire a shared lock for " . $this->filePath);
        }
    }
public function open()
    {
        if ($this->isOpened()) {
            return;
        }

        if (!file_exists($this->filePath)) {
            throw new \RuntimeException($this->filePath . " does not exist");
        }

        $this->handle = @fopen($this->filePath, self::OPEN_MODE);
        if ($this->handle === false) {
            throw new \RuntimeException("Could not open file for reading: " . $this->filePath);
        }

        if (!$this->lock(LOCK_SH)) {
            $this->close();
            throw new \RuntimeException("Could not aquire a shared lock for " . $this->filePath);
        }
    }
public function open ( ) { if ( $ this -> isOpened ( ) ) { return ; } if ( ! file_exists ( $ this -> filePath ) ) { throw new \ RuntimeException ( $ this -> filePath . " does not exist" ) ; } $ this -> handle = @ fopen ( $ this -> filePath , self :: OPEN_MODE ) ; if ( $ this -> handle === false ) { throw new \ RuntimeException ( "Could not open file for reading: " . $ this -> filePath ) ; } if ( ! $ this -> lock ( LOCK_SH ) ) { $ this -> close ( ) ; throw new \ RuntimeException ( "Could not aquire a shared lock for " . $ this -> filePath ) ; } }
Opens the file for reading

Obtains a shared lock for the file
@return void
@throws \RuntimeException On read/lock error
Opens the file for reading