ZF-5896: Provide ability to stream media uploads
This is a fairly large change to the underlying process that we currently have for uploading media entries in Zend_Gdata. The previous process was to construct a Zend_Mime_Message reading the entire binary file to be uploaded into a single string and then passing that around within the class structure. This proved to be very inefficient for video uploads to YouTube, especially when dealing with file sizes that approach 1 gig.
The new functionality creates a Zend_MediaMimeStream object instead and uses a Zend_Gdata_HttpAdapterStreamingProxy for the Zend_Gdata_HttpClient. Most of the complexity is in Zend_MediaMimeStream which creates RFC compliant MIME messages and has a read() method that can be called with an arbitrary buffer size (currently set to 1024b). This way both XML and binary can be read and streamed to the server in increments.
The new functionality has been tested through various unit-tests and functional tests.
Functional tests were run both on Linux and Windows platforms and included:
- uploading a < 1mb file to YouTube
- uploading a 100mb file to YouTube
- uploading a 800mb file to YouTube
Video meta-data included Kanji characters to ensure that potential issues with strings could be discovered.