cvs: php-src /ext/standard file.c
| From: | Wez Furlong | Date: | Sun, 06 Feb 2005 23:05:31 +0000 |
| Subject: | cvs: php-src /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-30298@lists.php.net to get a copy of this message | ||
wez Sun Feb 6 18:05:31 2005 EDT
Modified files:
/php-src/ext/standard file.c
Log:
support sucking data from streams in file_put_contents()
http://cvs.php.net/diff.php/php-src/ext/standard/file.c?r1=1.395&r2=1.396&ty=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.395 php-src/ext/standard/file.c:1.396
--- php-src/ext/standard/file.c:1.395 Sun Dec 12 18:21:53 2004
+++ php-src/ext/standard/file.c Sun Feb 6 18:05:24 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.395 2004/12/12 23:21:53 wez Exp $ */
+/* $Id: file.c,v 1.396 2005/02/06 23:05:24 wez Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -586,6 +586,15 @@
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: