docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 124 forks source link

ObjectSerializer opens SplFileObject with write-only permissions #36

Closed trickeyone closed 7 years ago

trickeyone commented 7 years ago

The ObjectSerializer opens the SplFileObject instance with write-only permissions. This makes doing any further operations on the file very difficult and usually requires re-opening the SplFileObject with a new instance.

If would be beneficial is the new instance of SplFileObject was changed from (ObjectSerializer:265):

$deserialized = new \SplFileObject($filename, "w");

to

$deserialized = new \SplFileObject($filename, "w+");

Making it capable of rewinding and reading from the same SplFileObject instance.

gsnavin commented 7 years ago

@trickeyone Thanks for bring this our attention, we will review this internally and make the change is we deem necessary. Until then please try reopening the file with a new instance for other operations. Sorry for the inconvenience.