public function save($id, $data)
    {
        $file = $this->getFilename($id);

        if (!$this->isWritable($file)) {
            throw new NotWritableException(sprintf('File could not be written to system as target is not writable: %s', $file));
        }

        if ($this->writeData($file, $data) === false) {

            $this->delete($file);

            throw new NotWritableException(sprintf('Data could not be written to file on system. Please make sure that file is writeable: %s', $file));
        }

        return $file;
    }
public function save($id, $data)
    {
        $file = $this->getFilename($id);

        if (!$this->isWritable($file)) {
            throw new NotWritableException(sprintf('File could not be written to system as target is not writable: %s', $file));
        }

        if ($this->writeData($file, $data) === false) {

            $this->delete($file);

            throw new NotWritableException(sprintf('Data could not be written to file on system. Please make sure that file is writeable: %s', $file));
        }

        return $file;
    }
public function save ( $ id , $ data ) { $ file = $ this -> getFilename ( $ id ) ; if ( ! $ this -> isWritable ( $ file ) ) { throw new NotWritableException ( sprintf ( 'File could not be written to system as target is not writable: %s' , $ file ) ) ; } if ( $ this -> writeData ( $ file , $ data ) === false ) { $ this -> delete ( $ file ) ; throw new NotWritableException ( sprintf ( 'Data could not be written to file on system. Please make sure that file is writeable: %s' , $ file ) ) ; } return $ file ; }
Write data to storage.

@access public
@param  string                                           $id
@param  string                                           $data
@return string
@throws \JonnyW\PhantomJs\Exception\NotWritableException
Write data to storage .