public function read($position)
    {
        $this->file->flock(LOCK_SH);
        $metadata = $this->getMetadata($position);

        $this->file->fseek($metadata->klen, SEEK_CUR);
        $value = $this->file->fread($metadata->vlen);
        $this->file->flock(LOCK_UN);

        $mixed = json_decode($value, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            return $value;
        }

        return $mixed;
    }
public function read($position)
    {
        $this->file->flock(LOCK_SH);
        $metadata = $this->getMetadata($position);

        $this->file->fseek($metadata->klen, SEEK_CUR);
        $value = $this->file->fread($metadata->vlen);
        $this->file->flock(LOCK_UN);

        $mixed = json_decode($value, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            return $value;
        }

        return $mixed;
    }
public function read ( $ position ) { $ this -> file -> flock ( LOCK_SH ) ; $ metadata = $ this -> getMetadata ( $ position ) ; $ this -> file -> fseek ( $ metadata -> klen , SEEK_CUR ) ; $ value = $ this -> file -> fread ( $ metadata -> vlen ) ; $ this -> file -> flock ( LOCK_UN ) ; $ mixed = json_decode ( $ value , true ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { return $ value ; } return $ mixed ; }
Retrieves the data from the database for a Key based on position

@param integer $position The offset in the file where the data is stored

@return array
Retrieves the data from the database for a Key based on position