cvs: php4 /ext/recode config.m4 php_recode.h recode.c
| From: | Jani Taskinen | Date: | Wed, 24 Apr 2002 12:45:57 +0000 |
| Subject: | cvs: php4 /ext/recode config.m4 php_recode.h recode.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11388@lists.php.net to get a copy of this message | ||
sniper Wed Apr 24 08:45:57 2002 EDT
Modified files:
/php4/ext/recode config.m4 php_recode.h recode.c
Log:
One big mess is a bit less mess now.
Index: php4/ext/recode/config.m4 diff -u php4/ext/recode/config.m4:1.8 php4/ext/recode/config.m4:1.9 --- php4/ext/recode/config.m4:1.8 Tue Mar 12 11:34:45 2002 +++ php4/ext/recode/config.m4 Wed Apr 24 08:45:55 2002 @@ -1,63 +1,46 @@ dnl -dnl $Id: config.m4,v 1.8 2002/03/12 16:34:45 sas Exp $ +dnl $Id: config.m4,v 1.9 2002/04/24 12:45:55 sniper Exp $ dnl PHP_ARG_WITH(recode,for recode support, [ --with-recode[=DIR] Include recode support.]) - if test "$PHP_RECODE" != "no"; then - RECODE_LIST="$PHP_RECODE /usr /usr/local /opt" +if test "$PHP_RECODE" != "no"; then + RECODE_LIST="$PHP_RECODE /usr /usr/local /opt" - for i in $RECODE_LIST; do - if test -f $i/include/recode.h; then - RECODE_DIR=$i - RECODE_INC=include - RECODE_LIB=lib - fi - if test -f $i/include/recode/recode.h; then - RECODE_DIR=$i - RECODE_INC=include/recode - RECODE_LIB=lib/recode - fi - if test -f $i/recode/include/recode.h; then - RECODE_DIR=$i/recode - RECODE_INC=include - RECODE_LIB=lib - fi - done - if test "$RECODE_DIR" = ""; then - AC_MSG_ERROR(I cannot find recode.h anywhere below $RECODE_LIST. Is it installed?) - fi - - old_LDFLAGS=$LDFLAGS - old_LIBS=$LIBS - LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" - LIBS="$LIBS -lrecode" - AC_TRY_LINK([ -char *program_name; -],[ -recode_format_table(); -],[],[ - AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) -]) - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - - if test "$RECODE_LIB" = ""; then - AC_MSG_ERROR(Please reinstall recode - I cannot find librecode.a) - fi - - PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) - if test "$ext_shared" = "yes"; then - PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) - PHP_SUBST(RECODE_SHARED_LIBADD) - else - PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB) - fi - - AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) - - AC_CHECK_HEADERS(stdbool.h) - - PHP_NEW_EXTENSION(recode, recode.c, $ext_shared) - fi + for i in $RECODE_LIST; do + if test -f $i/include/recode.h; then + RECODE_DIR=$i + RECODE_INC=include + RECODE_LIB=lib + fi + if test -f $i/include/recode/recode.h; then + RECODE_DIR=$i + RECODE_INC=include/recode + RECODE_LIB=lib/recode + fi + if test -f $i/recode/include/recode.h; then + RECODE_DIR=$i/recode + RECODE_INC=include + RECODE_LIB=lib + fi + done + + if test -z "$RECODE_DIR"; then + AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.]) + fi + + PHP_CHECK_LIBRARY(recode, recode_format_table, [ + AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) + ], [ + AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) + ], [ + -L$RECODE_DIR/$RECODE_LIB + ]) + + PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) + PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) + PHP_SUBST(RECODE_SHARED_LIBADD) + AC_CHECK_HEADERS(stdbool.h) + PHP_NEW_EXTENSION(recode, recode.c, $ext_shared) +fi Index: php4/ext/recode/php_recode.h diff -u php4/ext/recode/php_recode.h:1.12 php4/ext/recode/php_recode.h:1.13 --- php4/ext/recode/php_recode.h:1.12 Mon Mar 18 06:46:00 2002 +++ php4/ext/recode/php_recode.h Wed Apr 24 08:45:55 2002 @@ -14,67 +14,26 @@ +----------------------------------------------------------------------+ | Author: Kristian Koehntopp <kris@koehntopp.de> | +----------------------------------------------------------------------+ - */ +*/ - -/* $Id: php_recode.h,v 1.12 2002/03/18 11:46:00 wez Exp $ */ +/* $Id: php_recode.h,v 1.13 2002/04/24 12:45:55 sniper Exp $ */ #ifndef PHP_RECODE_H #define PHP_RECODE_H -#ifdef PHP_WIN32 -#define PHP_MYSQL_API __declspec(dllexport) -#else -#define PHP_MYSQL_API -#endif - #if HAVE_LIBRECODE -/* Checking for thread safety and issue warning if necessary. */ -#ifdef ZTS -#warning Recode module has not been tested for thread-safety. -#endif - -/* Recode 3.5 is broken in the sense that it requires the definition - * of a symbol "program_name" in order to link. - */ -#define HAVE_BROKEN_RECODE - -#ifdef HAVE_STDBOOL_H -# include <stdbool.h> -#else - typedef enum {false = 0, true = 1} bool; -#endif - -#include <sys/types.h> -#include <stdio.h> -#include <recode.h> -#include <unistd.h> - extern zend_module_entry recode_module_entry; #define phpext_recode_ptr &recode_module_entry PHP_MINIT_FUNCTION(recode); PHP_MSHUTDOWN_FUNCTION(recode); PHP_MINFO_FUNCTION(recode); - PHP_FUNCTION(recode_string); PHP_FUNCTION(recode_file); -#ifdef ZTS -#include "TSRM.h" -#endif - -ZEND_BEGIN_MODULE_GLOBALS(recode) - RECODE_OUTER outer; -ZEND_END_MODULE_GLOBALS(recode) - -#ifdef ZTS -#define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v) #else -#define ReSG(v) (recode_globals.v) -#endif - +#define phpext_recode_ptr NULL #endif #endif /* PHP_RECODE_H */ Index: php4/ext/recode/recode.c diff -u php4/ext/recode/recode.c:1.26 php4/ext/recode/recode.c:1.27 --- php4/ext/recode/recode.c:1.26 Sat Apr 20 14:33:54 2002 +++ php4/ext/recode/recode.c Wed Apr 24 08:45:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: recode.c,v 1.26 2002/04/20 18:33:54 derick Exp $ */ +/* $Id: recode.c,v 1.27 2002/04/24 12:45:55 sniper Exp $ */ /* {{{ includes & prototypes */ @@ -25,26 +25,43 @@ #endif #include "php.h" -#include "php_recode.h" #include "php_streams.h" #if HAVE_LIBRECODE -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" -#include "zend_list.h" - -#ifdef HAVE_BROKEN_RECODE +/* For recode 3.5 */ extern char *program_name; char *program_name = "php"; + +#ifdef HAVE_STDBOOL_H +# include <stdbool.h> +#else + typedef enum {false = 0, true = 1} bool; #endif -/* }}} */ -#define SAFE_STRING(s) ((s)?(s):"") +#include <stdio.h> +#include <sys/types.h> +#include <unistd.h> +#include <recode.h> + +#include "php_recode.h" +#include "ext/standard/info.h" +#include "ext/standard/file.h" +#include "ext/standard/php_string.h" + +/* }}} */ +ZEND_BEGIN_MODULE_GLOBALS(recode) + RECODE_OUTER outer; +ZEND_END_MODULE_GLOBALS(recode) + +#ifdef ZTS +# define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v) +#else +# define ReSG(v) (recode_globals.v) +#endif + ZEND_DECLARE_MODULE_GLOBALS(recode); -extern int le_fp,le_pp; /* {{{ module stuff */ static zend_function_entry php_recode_functions[] = { @@ -55,22 +72,18 @@ }; zend_module_entry recode_module_entry = { - STANDARD_MODULE_HEADER, + STANDARD_MODULE_HEADER, "recode", - php_recode_functions, + php_recode_functions, PHP_MINIT(recode), PHP_MSHUTDOWN(recode), NULL, NULL, PHP_MINFO(recode), - NO_VERSION_YET, + NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; -#if APACHE -extern void timeout(int sig); -#endif - #ifdef COMPILE_DL_RECODE ZEND_GET_MODULE(recode) #endif @@ -84,14 +97,14 @@ { ZEND_INIT_MODULE_GLOBALS(recode, php_recode_init_globals, NULL); - ReSG(outer) = recode_new_outer(true); - if (ReSG(outer) == NULL) + ReSG(outer) = recode_new_outer(false); + if (ReSG(outer) == NULL) { return FAILURE; - + } + return SUCCESS; } - PHP_MSHUTDOWN_FUNCTION(recode) { if (ReSG(outer)) { @@ -100,36 +113,33 @@ return SUCCESS; } - PHP_MINFO_FUNCTION(recode) { php_info_print_table_start(); php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.26 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.27 $"); php_info_print_table_end(); - } /* {{{ proto string recode_string(string request, string str) Recode string str according to request string */ - PHP_FUNCTION(recode_string) { RECODE_REQUEST request = NULL; char *r = NULL; - pval **str; - pval **req; + zval **str; + zval **req; bool success; int r_len=0, r_alen =0; - if (ZEND_NUM_ARGS() != 2 - || zend_get_parameters_ex(2, &req, &str) == FAILURE) { - WRONG_PARAM_COUNT; + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &req, &str) == FAILURE) { + WRONG_PARAM_COUNT; } convert_to_string_ex(str); convert_to_string_ex(req); request = recode_new_request(ReSG(outer)); + if (request == NULL) { php_error(E_WARNING, "Cannot allocate request structure"); RETURN_FALSE; @@ -168,20 +178,17 @@ { RECODE_REQUEST request = NULL; int success; - pval **req; - pval **input, **output; + zval **req; + zval **input, **output; php_stream *instream, *outstream; FILE *in_fp, *out_fp; int in_type, out_type; - - if (ZEND_NUM_ARGS() != 3 - || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { WRONG_PARAM_COUNT; } - instream = zend_fetch_resource(input TSRMLS_CC,-1, "File-Handle", &in_type, - 1, php_file_le_stream()); + instream = zend_fetch_resource(input TSRMLS_CC,-1, "File-Handle", &in_type, 1, php_file_le_stream()); if (!instream) { php_error(E_WARNING,"Unable to find input file identifier"); @@ -192,8 +199,7 @@ RETURN_FALSE; } - outstream = zend_fetch_resource(output TSRMLS_CC,-1, "File-Handle", &out_type, - 1, php_file_le_stream()); + outstream = zend_fetch_resource(output TSRMLS_CC,-1, "File-Handle", &out_type, 1, php_file_le_stream()); if (!outstream) { php_error(E_WARNING,"Unable to find output file identifier"); RETURN_FALSE;
Index: php4/ext/recode/config.m4 diff -u php4/ext/recode/config.m4:1.8 php4/ext/recode/config.m4:1.9 --- php4/ext/recode/config.m4:1.8 Tue Mar 12 11:34:45 2002 +++ php4/ext/recode/config.m4 Wed Apr 24 08:45:55 2002 @@ -1,63 +1,46 @@ dnl -dnl $Id: config.m4,v 1.8 2002/03/12 16:34:45 sas Exp $ +dnl $Id: config.m4,v 1.9 2002/04/24 12:45:55 sniper Exp $ dnl PHP_ARG_WITH(recode,for recode support, [ --with-recode[=DIR] Include recode support.]) - if test "$PHP_RECODE" != "no"; then - RECODE_LIST="$PHP_RECODE /usr /usr/local /opt" +if test "$PHP_RECODE" != "no"; then + RECODE_LIST="$PHP_RECODE /usr /usr/local /opt" - for i in $RECODE_LIST; do - if test -f $i/include/recode.h; then - RECODE_DIR=$i - RECODE_INC=include - RECODE_LIB=lib - fi - if test -f $i/include/recode/recode.h; then - RECODE_DIR=$i - RECODE_INC=include/recode - RECODE_LIB=lib/recode - fi - if test -f $i/recode/include/recode.h; then - RECODE_DIR=$i/recode - RECODE_INC=include - RECODE_LIB=lib - fi - done - if test "$RECODE_DIR" = ""; then - AC_MSG_ERROR(I cannot find recode.h anywhere below $RECODE_LIST. Is it installed?) - fi - - old_LDFLAGS=$LDFLAGS - old_LIBS=$LIBS - LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" - LIBS="$LIBS -lrecode" - AC_TRY_LINK([ -char *program_name; -],[ -recode_format_table(); -],[],[ - AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) -]) - LIBS=$old_LIBS - LDFLAGS=$old_LDFLAGS - - if test "$RECODE_LIB" = ""; then - AC_MSG_ERROR(Please reinstall recode - I cannot find librecode.a) - fi - - PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) - if test "$ext_shared" = "yes"; then - PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) - PHP_SUBST(RECODE_SHARED_LIBADD) - else - PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB) - fi - - AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) - - AC_CHECK_HEADERS(stdbool.h) - - PHP_NEW_EXTENSION(recode, recode.c, $ext_shared) - fi + for i in $RECODE_LIST; do + if test -f $i/include/recode.h; then + RECODE_DIR=$i + RECODE_INC=include + RECODE_LIB=lib + fi + if test -f $i/include/recode/recode.h; then + RECODE_DIR=$i + RECODE_INC=include/recode + RECODE_LIB=lib/recode + fi + if test -f $i/recode/include/recode.h; then + RECODE_DIR=$i/recode + RECODE_INC=include + RECODE_LIB=lib + fi + done + + if test -z "$RECODE_DIR"; then + AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.]) + fi + + PHP_CHECK_LIBRARY(recode, recode_format_table, [ + AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) + ], [ + AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) + ], [ + -L$RECODE_DIR/$RECODE_LIB + ]) + + PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) + PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD) + PHP_SUBST(RECODE_SHARED_LIBADD) + AC_CHECK_HEADERS(stdbool.h) + PHP_NEW_EXTENSION(recode, recode.c, $ext_shared) +fi Index: php4/ext/recode/php_recode.h diff -u php4/ext/recode/php_recode.h:1.12 php4/ext/recode/php_recode.h:1.13 --- php4/ext/recode/php_recode.h:1.12 Mon Mar 18 06:46:00 2002 +++ php4/ext/recode/php_recode.h Wed Apr 24 08:45:55 2002 @@ -14,67 +14,26 @@ +----------------------------------------------------------------------+ | Author: Kristian Koehntopp <kris@koehntopp.de> | +----------------------------------------------------------------------+ - */ +*/ - -/* $Id: php_recode.h,v 1.12 2002/03/18 11:46:00 wez Exp $ */ +/* $Id: php_recode.h,v 1.13 2002/04/24 12:45:55 sniper Exp $ */ #ifndef PHP_RECODE_H #define PHP_RECODE_H -#ifdef PHP_WIN32 -#define PHP_MYSQL_API __declspec(dllexport) -#else -#define PHP_MYSQL_API -#endif - #if HAVE_LIBRECODE -/* Checking for thread safety and issue warning if necessary. */ -#ifdef ZTS -#warning Recode module has not been tested for thread-safety. -#endif - -/* Recode 3.5 is broken in the sense that it requires the definition - * of a symbol "program_name" in order to link. - */ -#define HAVE_BROKEN_RECODE - -#ifdef HAVE_STDBOOL_H -# include <stdbool.h> -#else - typedef enum {false = 0, true = 1} bool; -#endif - -#include <sys/types.h> -#include <stdio.h> -#include <recode.h> -#include <unistd.h> - extern zend_module_entry recode_module_entry; #define phpext_recode_ptr &recode_module_entry PHP_MINIT_FUNCTION(recode); PHP_MSHUTDOWN_FUNCTION(recode); PHP_MINFO_FUNCTION(recode); - PHP_FUNCTION(recode_string); PHP_FUNCTION(recode_file); -#ifdef ZTS -#include "TSRM.h" -#endif - -ZEND_BEGIN_MODULE_GLOBALS(recode) - RECODE_OUTER outer; -ZEND_END_MODULE_GLOBALS(recode) - -#ifdef ZTS -#define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v) #else -#define ReSG(v) (recode_globals.v) -#endif - +#define phpext_recode_ptr NULL #endif #endif /* PHP_RECODE_H */ Index: php4/ext/recode/recode.c diff -u php4/ext/recode/recode.c:1.26 php4/ext/recode/recode.c:1.27 --- php4/ext/recode/recode.c:1.26 Sat Apr 20 14:33:54 2002 +++ php4/ext/recode/recode.c Wed Apr 24 08:45:55 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: recode.c,v 1.26 2002/04/20 18:33:54 derick Exp $ */ +/* $Id: recode.c,v 1.27 2002/04/24 12:45:55 sniper Exp $ */ /* {{{ includes & prototypes */ @@ -25,26 +25,43 @@ #endif #include "php.h" -#include "php_recode.h" #include "php_streams.h" #if HAVE_LIBRECODE -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" -#include "zend_list.h" - -#ifdef HAVE_BROKEN_RECODE +/* For recode 3.5 */ extern char *program_name; char *program_name = "php"; + +#ifdef HAVE_STDBOOL_H +# include <stdbool.h> +#else + typedef enum {false = 0, true = 1} bool; #endif -/* }}} */ -#define SAFE_STRING(s) ((s)?(s):"") +#include <stdio.h> +#include <sys/types.h> +#include <unistd.h> +#include <recode.h> + +#include "php_recode.h" +#include "ext/standard/info.h" +#include "ext/standard/file.h" +#include "ext/standard/php_string.h" + +/* }}} */ +ZEND_BEGIN_MODULE_GLOBALS(recode) + RECODE_OUTER outer; +ZEND_END_MODULE_GLOBALS(recode) + +#ifdef ZTS +# define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v) +#else +# define ReSG(v) (recode_globals.v) +#endif + ZEND_DECLARE_MODULE_GLOBALS(recode); -extern int le_fp,le_pp; /* {{{ module stuff */ static zend_function_entry php_recode_functions[] = { @@ -55,22 +72,18 @@ }; zend_module_entry recode_module_entry = { - STANDARD_MODULE_HEADER, + STANDARD_MODULE_HEADER, "recode", - php_recode_functions, + php_recode_functions, PHP_MINIT(recode), PHP_MSHUTDOWN(recode), NULL, NULL, PHP_MINFO(recode), - NO_VERSION_YET, + NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; -#if APACHE -extern void timeout(int sig); -#endif - #ifdef COMPILE_DL_RECODE ZEND_GET_MODULE(recode) #endif @@ -84,14 +97,14 @@ { ZEND_INIT_MODULE_GLOBALS(recode, php_recode_init_globals, NULL); - ReSG(outer) = recode_new_outer(true); - if (ReSG(outer) == NULL) + ReSG(outer) = recode_new_outer(false); + if (ReSG(outer) == NULL) { return FAILURE; - + } + return SUCCESS; } - PHP_MSHUTDOWN_FUNCTION(recode) { if (ReSG(outer)) { @@ -100,36 +113,33 @@ return SUCCESS; } - PHP_MINFO_FUNCTION(recode) { php_info_print_table_start(); php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.26 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.27 $"); php_info_print_table_end(); - } /* {{{ proto string recode_string(string request, string str) Recode string str according to request string */ - PHP_FUNCTION(recode_string) { RECODE_REQUEST request = NULL; char *r = NULL; - pval **str; - pval **req; + zval **str; + zval **req; bool success; int r_len=0, r_alen =0; - if (ZEND_NUM_ARGS() != 2 - || zend_get_parameters_ex(2, &req, &str) == FAILURE) { - WRONG_PARAM_COUNT; + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &req, &str) == FAILURE) { + WRONG_PARAM_COUNT; } convert_to_string_ex(str); convert_to_string_ex(req); request = recode_new_request(ReSG(outer)); + if (request == NULL) { php_error(E_WARNING, "Cannot allocate request structure"); RETURN_FALSE; @@ -168,20 +178,17 @@ { RECODE_REQUEST request = NULL; int success; - pval **req; - pval **input, **output; + zval **req; + zval **input, **output; php_stream *instream, *outstream; FILE *in_fp, *out_fp; int in_type, out_type; - - if (ZEND_NUM_ARGS() != 3 - || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { WRONG_PARAM_COUNT; } - instream = zend_fetch_resource(input TSRMLS_CC,-1, "File-Handle", &in_type, - 1, php_file_le_stream()); + instream = zend_fetch_resource(input TSRMLS_CC,-1, "File-Handle", &in_type, 1, php_file_le_stream()); if (!instream) { php_error(E_WARNING,"Unable to find input file identifier"); @@ -192,8 +199,7 @@ RETURN_FALSE; } - outstream = zend_fetch_resource(output TSRMLS_CC,-1, "File-Handle", &out_type, - 1, php_file_le_stream()); + outstream = zend_fetch_resource(output TSRMLS_CC,-1, "File-Handle", &out_type, 1, php_file_le_stream()); if (!outstream) { php_error(E_WARNING,"Unable to find output file identifier"); RETURN_FALSE;