private function save()
    {
        $encodedContent = gzencode(json_encode($this->content));

        if (!file_exists($this->file)) {
            touch($this->file);
        }

        $fh = fopen($this->file, 'r+');

        if (flock($fh, LOCK_EX)) {
            ftruncate($fh, 0);
            fwrite($fh, $encodedContent);
            fflush($fh);
            flock($fh, LOCK_UN);
            fclose($fh);
        } else {
            throw new \Exception('Could not acquire exclusive file lock.');
        }
    }
private function save()
    {
        $encodedContent = gzencode(json_encode($this->content));

        if (!file_exists($this->file)) {
            touch($this->file);
        }

        $fh = fopen($this->file, 'r+');

        if (flock($fh, LOCK_EX)) {
            ftruncate($fh, 0);
            fwrite($fh, $encodedContent);
            fflush($fh);
            flock($fh, LOCK_UN);
            fclose($fh);
        } else {
            throw new \Exception('Could not acquire exclusive file lock.');
        }
    }
private function save ( ) { $ encodedContent = gzencode ( json_encode ( $ this -> content ) ) ; if ( ! file_exists ( $ this -> file ) ) { touch ( $ this -> file ) ; } $ fh = fopen ( $ this -> file , 'r+' ) ; if ( flock ( $ fh , LOCK_EX ) ) { ftruncate ( $ fh , 0 ) ; fwrite ( $ fh , $ encodedContent ) ; fflush ( $ fh ) ; flock ( $ fh , LOCK_UN ) ; fclose ( $ fh ) ; } else { throw new \ Exception ( 'Could not acquire exclusive file lock.' ) ; } }
Save contents to store.

@throws Exception

@return void
Save contents to store .