ソースを参照

document s3 streaming

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19227 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas 16 年 前
コミット
e7daa036df

+ 37 - 0
documentation/manual/en/module_specs/Zend_Service_Amazon_S3.xml

@@ -372,6 +372,43 @@ foreach($list as $name) {
             </listitem>
        </itemizedlist>
     </sect2>
+    <sect2 id="zend.service.amazon.s3.streaming">
+    	<title>Data Streaming</title>
+    	<para>
+    	It is possible to get and put objects using not stream data held in memory but files or PHP streams.
+    	This is especially useful when file sizes are large in order not to overcome memory limits. 
+    	</para>
+    	<para>
+    	To receive object using streaming, use method <methodname>getObjectStream($object, $filename)</methodname>. This method
+    	will return <classname>Zend_Http_Response_Stream</classname>, which can be used as described in 
+    	<link linkend="zend.http.client.streaming">HTTP Client Data Streaming</link> section.  
+    	<example id="zend.service.amazon.s3.streaming.example1">
+    	<title>Zend_Service_Amazon_S3 Data Streaming Example</title>
+             <programlisting language="php"><![CDATA[
+$response = $amazon->getObjectStream("mybycket/zftest");
+// copy file
+copy($response->getStreamName(), "my/downloads/file");
+// use stream
+$fp = fopen("my/downloads/file2", "w");
+stream_copy_to_stream($response->getStream(), $fp);
+]]></programlisting>
+		</example>
+    	</para>
+    	<para>Second parameter for <methodname>getObjectStream()</methodname> is optional and specifies target file
+    	 to write the data. If not specified, temporary file is used, which will be deleted after 
+    	 the respons eobject is destroyed.
+    	 </para>
+    	 
+    	 <para>
+    	 To send object using streaming, use <methodname>putFileStream()</methodname> which has the same signature as
+    	 <methodname>putFile()</methodname> but will use streaming and not read the file into memory.
+    	 </para>
+    	 
+    	 <para>
+    	 Also, you can pass stream resource to <methodname>putObject()</methodname> method data parameter,
+    	 in which case the data will be read from the stream when sending the request to the server. 
+    	 </para>
+    </sect2>
     <sect2 id="zend.service.amazon.s3.streams">
         <title>Stream wrapper</title>
         <para>