cvs: phpdoc /en/reference/stream/functions stream-copy-to-stream.xml

From: Date: Sat, 19 Apr 2003 03:01:32 +0000
Subject: cvs: phpdoc /en/reference/stream/functions stream-copy-to-stream.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352675@lists.php.net to get a copy of this message
pollita Fri Apr 18 23:01:32 2003 EDT Modified files: /phpdoc/en/reference/stream/functions stream-copy-to-stream.xml Log: Update re: parameters now accepting string urls Index: phpdoc/en/reference/stream/functions/stream-copy-to-stream.xml diff -u phpdoc/en/reference/stream/functions/stream-copy-to-stream.xml:1.1 phpdoc/en/reference/stream/functions/stream-copy-to-stream.xml:1.2 --- phpdoc/en/reference/stream/functions/stream-copy-to-stream.xml:1.1 Fri Apr 4 16:20:26 2003 +++ phpdoc/en/reference/stream/functions/stream-copy-to-stream.xml Fri Apr 18 23:01:32 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.stream-copy-to-stream"> <refnamediv> <refname>stream_copy_to_stream</refname> @@ -9,10 +9,20 @@ <title>Description</title> <methodsynopsis> <type>int</type><methodname>stream_copy_to_stream</methodname> - <methodparam><type>resource</type><parameter>source</parameter></methodparam> - <methodparam><type>resource</type><parameter>dest</parameter></methodparam> + <methodparam><type>resource|string</type><parameter>source</parameter></methodparam> + <methodparam><type>resource|string</type><parameter>dest</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>maxlength</parameter></methodparam> </methodsynopsis> + <simpara> + <parameter>source</parameter> and <parameter>dest</parameter> can each be + either an active stream resource (opened with <function>fopen</function>, + <function>fsockopen</function>, <function>stream_socket_connect</function>, + <function>stream_socket_accept</function>, or another stream creation + function), or a string pointing to a filename or valid wrapper resource. + If <parameter>source</parameter> or <parameter>dest</parameter> are strings, + <literal>PHP</literal> will attempt to open the stream from reading or + writting as appropriate, perform the copy, then close it. + </simpara> <para> Makes a copy of up to <parameter>maxlength</parameter> bytes of data from the current position in <parameter>source</parameter> to @@ -31,6 +41,19 @@ print stream_copy_to_stream($src, $dest1, 1024) . " bytes copied to first1k.txt\n"; print stream_copy_to_stream($src, $dest2) . " bytes copied to remainder.txt\n"; +?> +]]> + </programlisting> + </example> + <example> + <title>Using <function>stream_copy_to_stream</function> on urls</title> + <programlisting role="php"> +<![CDATA[ +<?php +$src = 'http://www.example.com/path/to/file.txt'; +$dest = 'compress.zlib://file.txt'; + +print stream_copy_to_stream($src, $dest) . " bytes copied from webserver and written to compressed local file.\n"; ?> ]]> </programlisting>

« previous php.doc (#969352675) next »