[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] php4-ming Bug #210360 #215228



Hi,

this patch should close #210360 and #215228


greetings
	Klaus
--- libming-0.2a.cvs20030716/php_ext/ming.c	2003-07-16 17:40:41.000000000 +0200
+++ libming-debian-fixed/php_ext/ming.c	2004-01-11 19:26:42.000000000 +0100
@@ -225,6 +225,30 @@
   destroySWFInput((SWFInput)resource->ptr);
 }
 
+#if (ZEND_MODULE_API_NO >= 20020429)
+
+static SWFInput getInput(zval **zfile TSRMLS_DC)
+{
+	FILE *file;
+	void *what;
+	int type;
+	SWFInput input;
+
+	what = zend_fetch_resource(zfile TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
+
+	if (php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void *) &file, REPORT_ERRORS) != SUCCESS) {
+		return NULL;
+	}
+  
+	input = newSWFInput_file(file);
+	zend_list_addref(Z_LVAL_PP(zfile));
+	zend_list_addref(zend_list_insert(input, le_swfinputp));
+	return input;
+}
+
+#else
+
+
 #define SOCKBUF_INCREMENT 10240
 
 /* turn a socket into an SWFInput by copying everything to a buffer. */
@@ -272,7 +296,7 @@
 
   return input;
 }
-
+#endif
 /* }}} */
 
 /* {{{ SWFAction */

Reply to: