]> granicus.if.org Git - php/commitdiff
support sucking data from streams in file_put_contents()
authorWez Furlong <wez@php.net>
Sun, 6 Feb 2005 23:05:24 +0000 (23:05 +0000)
committerWez Furlong <wez@php.net>
Sun, 6 Feb 2005 23:05:24 +0000 (23:05 +0000)
ext/standard/file.c

index f25f8a49f49b9e0864ef9f0e68495f6a8df07459..b86dad6a5f0293755fcb4e41bd7d9f258412dc6d 100644 (file)
@@ -586,6 +586,15 @@ PHP_FUNCTION(file_put_contents)
                RETURN_FALSE;
        }
        switch (Z_TYPE_P(data)) {
+               case IS_RESOURCE:
+               {
+                       php_stream *srcstream;
+                       php_stream_from_zval(srcstream, &data);
+
+                       numbytes = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);
+
+                       break;
+               }
                case IS_NULL:
                case IS_LONG:
                case IS_DOUBLE: