cvs: pecl /zip php_zip.c php_zip.h
| From: | Marcus Boerger | Date: | Mon, 27 Feb 2006 13:26:53 +0000 |
| Subject: | cvs: pecl /zip php_zip.c php_zip.h | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-5278@lists.php.net to get a copy of this message | ||
helly Mon Feb 27 13:26:53 2006 UTC
Modified files:
/pecl/zip php_zip.c php_zip.h
Log:
- Cleanup
- Fix a memleak in shutdown
- Fix warnings
- Fix TSRM build
- Prefix internal funcs with 'php_' to prevent conflicts with lib functions
http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.c?r1=1.13&r2=1.14&diff_format=u Index: pecl/zip/php_zip.c diff -u pecl/zip/php_zip.c:1.13 pecl/zip/php_zip.c:1.14 --- pecl/zip/php_zip.c:1.13 Fri Feb 24 00:38:45 2006 +++ pecl/zip/php_zip.c Mon Feb 27 13:26:52 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zip.c,v 1.13 2006/02/24 00:38:45 pajoye Exp $ */ +/* $Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -35,17 +35,9 @@ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC) /* }}} */ -/* {{{ zip_get_status */ -static int zip_get_status(struct zip *za) { - int zep, syp; - zip_error_get(za, &zep, &syp); - return zep; -} -/* }}} */ - -/* {{{ zip_extract_file */ +/* {{{ php_zip_extract_file */ /* TODO: Simplify it */ -static int zip_extract_file(struct zip * za, char *dest, char *file TSRMLS_DC) +static int php_zip_extract_file(struct zip * za, char *dest, char *file TSRMLS_DC) { php_stream_statbuf ssb; struct zip_file *zf; @@ -167,8 +159,8 @@ } /* }}} */ -/* {{{ zip_get_status */ -static int zip_status(struct zip *za TSRMLS_DC) { +static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */ +{ int zep, syp; zip_error_get(za, &zep, &syp); @@ -176,8 +168,8 @@ } /* }}} */ -/* {{{ zip_get_status */ -static int zip_status_sys(struct zip *za TSRMLS_DC) { +static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */ +{ int zep, syp; zip_error_get(za, &zep, &syp); @@ -185,8 +177,14 @@ } /* }}} */ -/* {{{ zip_get_filename */ -static char * zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) { +static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */ +{ + return zip_get_num_files(za); +} +/* }}} */ + +static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */ +{ if (!obj) { return NULL; } @@ -194,6 +192,7 @@ if (obj->filename) { return obj->filename; } + return NULL; } /* }}} */ @@ -207,9 +206,9 @@ static HashTable zip_prop_handlers; -typedef int (*zip_read_int_t)(struct zip *za); -typedef char *(*zip_read_const_char_t)(struct zip *za); -typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj); +typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC); +typedef char *(*zip_read_const_char_t)(struct zip *za TSRMLS_DC); +typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC); typedef struct _zip_prop_handler { @@ -220,8 +219,7 @@ int type; } zip_prop_handler; -/* {{{ zip_register_prop_handler */ -static void zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) +static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */ { zip_prop_handler hnd; @@ -233,25 +231,24 @@ } /* }}} */ -/* {{{ zip_property_reader */ -static int zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval TSRMLS_DC) +static int php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval TSRMLS_DC) /* {{{ */ { const char *retchar = NULL; int retint = 0; if (obj && obj->za != NULL) { if (hnd->read_const_char_func) { - retchar = hnd->read_const_char_func(obj->za); + retchar = hnd->read_const_char_func(obj->za TSRMLS_CC); } else { if (hnd->read_int_func) { - retint = hnd->read_int_func(obj->za); + retint = hnd->read_int_func(obj->za TSRMLS_CC); if (retint == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned"); return FAILURE; } } else { if (hnd->read_const_char_from_obj_func) { - retchar = hnd->read_const_char_from_obj_func(obj); + retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC); } } } @@ -281,8 +278,7 @@ } /* }}} */ -/* {{{ zip_read_property */ -zval *zip_read_property(zval *object, zval *member, int type TSRMLS_DC) +zval* php_zip_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ { ze_zip_object *obj; zval tmp_member; @@ -306,7 +302,7 @@ } if (ret == SUCCESS) { - ret = zip_property_reader(obj, hnd, &retval TSRMLS_CC); + ret = php_zip_property_reader(obj, hnd, &retval TSRMLS_CC); if (ret == SUCCESS) { /* ensure we're creating a temporary variable */ retval->refcount = 0; @@ -325,8 +321,7 @@ } /* }}} */ -/* {{{ zip_object_free_storage */ -static void zip_object_free_storage(void *object TSRMLS_DC) +static void php_zip_object_free_storage(void *object TSRMLS_DC) /* {{{ */ { ze_zip_object * intern = (ze_zip_object *) object; int i; @@ -358,8 +353,7 @@ } /* }}} */ -/* {{{ zip_object_new */ -PHP_ZIP_API zend_object_value zip_object_new(zend_class_entry *class_type TSRMLS_DC) +PHP_ZIP_API zend_object_value php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { ze_zip_object *intern; zval *tmp; @@ -382,7 +376,7 @@ retval.handle = zend_objects_store_put(intern, NULL, - (zend_objects_free_object_storage_t) zip_object_free_storage, + (zend_objects_free_object_storage_t) php_zip_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) & zip_object_handlers; @@ -395,8 +389,6 @@ PHP_MINIT_FUNCTION(zip); PHP_MSHUTDOWN_FUNCTION(zip); PHP_MINFO_FUNCTION(zip); - -static int le_zip; /* }}} */ /* {{{ zip_module_entry @@ -419,13 +411,6 @@ ZEND_GET_MODULE(zip) #endif -/* {{{ zip_objects_clone */ -void zip_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - /* TODO */ -} -/* }}} */ - /* {{{ proto resource open(resource zip, string source) Create new zip using source uri for output */ PHP_METHOD(zip, open) @@ -503,7 +488,6 @@ int filename_len; char *entry_name = NULL; int entry_name_len = 0; - ze_zip_object ze_obj; struct zip_source *zs; int offset_start = 0, offset_len = 0; @@ -547,7 +531,7 @@ { struct zip *intern; zval *this = getThis(); - char *buffer, *buffer_cpy, *name; + char *buffer, *name; int buffer_len, name_len; ze_zip_object *ze_obj; struct zip_source *zs; @@ -598,7 +582,6 @@ char *name; int name_len; long flags; - ze_zip_object *ze_obj; struct zip_stat sb; if (!this) { @@ -631,7 +614,6 @@ struct zip *intern; zval *this = getThis(); long flags, index; - ze_zip_object *ze_obj; struct zip_stat sb; @@ -660,7 +642,6 @@ { struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; long index; @@ -691,7 +672,6 @@ { struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; char *new_name; int new_name_len; @@ -735,15 +715,13 @@ struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; zval *zval_files = NULL; zval **zval_file = NULL; php_stream_statbuf ssb; char *pathto; char *file; int pathto_len; - int ret, len, i; - char *fullpath; + int ret, i; int nelems; @@ -773,7 +751,7 @@ switch (Z_TYPE_P(zval_files)) { case IS_STRING: file = Z_STRVAL_P(zval_files); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } break; @@ -789,7 +767,7 @@ break; case IS_STRING: file = Z_STRVAL_PP(zval_file); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } break; @@ -812,8 +790,8 @@ } for (i = 0; i < filecount; i++) { - file = zip_get_name(intern, i, ZIP_FL_UNCHANGED); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } } @@ -887,17 +865,17 @@ zip_object_handlers.get_property_ptr_ptr = NULL; zip_object_handlers.write_property = NULL; - zip_object_handlers.read_property = zip_read_property; + zip_object_handlers.read_property = php_zip_read_property; INIT_CLASS_ENTRY(ce, "Zip", zip_class_functions); - ce.create_object = zip_object_new; + ce.create_object = php_zip_object_new; zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC); zend_hash_init(&zip_prop_handlers, 0, NULL, NULL, 1); - zip_register_prop_handler(&zip_prop_handlers, "status", zip_status, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "statusSys", zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "numFiles", zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, zipobj_get_filename, IS_STRING TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC); REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE); REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL); @@ -955,10 +933,11 @@ */ PHP_MSHUTDOWN_FUNCTION(zip) { + zend_hash_destroy(&zip_prop_handlers); #if ZIP_USE_WRAPPER php_unregister_url_stream_wrapper("zip" TSRMLS_CC); - return SUCCESS; #endif + return SUCCESS; } /* }}} */ @@ -969,7 +948,7 @@ php_info_print_table_start(); { php_info_print_table_row(2, "Zip", "enabled"); - php_info_print_table_row(2, "$Id: php_zip.c,v 1.13 2006/02/24 00:38:45 pajoye Exp $", "enabled"); + php_info_print_table_row(2, "$Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $", "enabled"); php_info_print_table_row(2, "Libzip version", "0.6.1"); } php_info_print_table_end(); http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.h?r1=1.5&r2=1.6&diff_format=u Index: pecl/zip/php_zip.h diff -u pecl/zip/php_zip.h:1.5 pecl/zip/php_zip.h:1.6 --- pecl/zip/php_zip.h:1.5 Wed Jan 18 00:28:50 2006 +++ pecl/zip/php_zip.h Mon Feb 27 13:26:52 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zip.h,v 1.5 2006/01/18 00:28:50 fmk Exp $ */ +/* $Id: php_zip.h,v 1.6 2006/02/27 13:26:52 helly Exp $ */ #ifndef PHP_ZIP_H #define PHP_ZIP_H @@ -47,8 +47,6 @@ int filename_len; } ze_zip_object; -static void zip_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); - zend_class_entry *zip_class_entry_ce; php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.c?r1=1.13&r2=1.14&diff_format=u Index: pecl/zip/php_zip.c diff -u pecl/zip/php_zip.c:1.13 pecl/zip/php_zip.c:1.14 --- pecl/zip/php_zip.c:1.13 Fri Feb 24 00:38:45 2006 +++ pecl/zip/php_zip.c Mon Feb 27 13:26:52 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zip.c,v 1.13 2006/02/24 00:38:45 pajoye Exp $ */ +/* $Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -35,17 +35,9 @@ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC) /* }}} */ -/* {{{ zip_get_status */ -static int zip_get_status(struct zip *za) { - int zep, syp; - zip_error_get(za, &zep, &syp); - return zep; -} -/* }}} */ - -/* {{{ zip_extract_file */ +/* {{{ php_zip_extract_file */ /* TODO: Simplify it */ -static int zip_extract_file(struct zip * za, char *dest, char *file TSRMLS_DC) +static int php_zip_extract_file(struct zip * za, char *dest, char *file TSRMLS_DC) { php_stream_statbuf ssb; struct zip_file *zf; @@ -167,8 +159,8 @@ } /* }}} */ -/* {{{ zip_get_status */ -static int zip_status(struct zip *za TSRMLS_DC) { +static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */ +{ int zep, syp; zip_error_get(za, &zep, &syp); @@ -176,8 +168,8 @@ } /* }}} */ -/* {{{ zip_get_status */ -static int zip_status_sys(struct zip *za TSRMLS_DC) { +static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */ +{ int zep, syp; zip_error_get(za, &zep, &syp); @@ -185,8 +177,14 @@ } /* }}} */ -/* {{{ zip_get_filename */ -static char * zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) { +static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */ +{ + return zip_get_num_files(za); +} +/* }}} */ + +static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */ +{ if (!obj) { return NULL; } @@ -194,6 +192,7 @@ if (obj->filename) { return obj->filename; } + return NULL; } /* }}} */ @@ -207,9 +206,9 @@ static HashTable zip_prop_handlers; -typedef int (*zip_read_int_t)(struct zip *za); -typedef char *(*zip_read_const_char_t)(struct zip *za); -typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj); +typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC); +typedef char *(*zip_read_const_char_t)(struct zip *za TSRMLS_DC); +typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC); typedef struct _zip_prop_handler { @@ -220,8 +219,7 @@ int type; } zip_prop_handler; -/* {{{ zip_register_prop_handler */ -static void zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) +static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */ { zip_prop_handler hnd; @@ -233,25 +231,24 @@ } /* }}} */ -/* {{{ zip_property_reader */ -static int zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval TSRMLS_DC) +static int php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval TSRMLS_DC) /* {{{ */ { const char *retchar = NULL; int retint = 0; if (obj && obj->za != NULL) { if (hnd->read_const_char_func) { - retchar = hnd->read_const_char_func(obj->za); + retchar = hnd->read_const_char_func(obj->za TSRMLS_CC); } else { if (hnd->read_int_func) { - retint = hnd->read_int_func(obj->za); + retint = hnd->read_int_func(obj->za TSRMLS_CC); if (retint == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned"); return FAILURE; } } else { if (hnd->read_const_char_from_obj_func) { - retchar = hnd->read_const_char_from_obj_func(obj); + retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC); } } } @@ -281,8 +278,7 @@ } /* }}} */ -/* {{{ zip_read_property */ -zval *zip_read_property(zval *object, zval *member, int type TSRMLS_DC) +zval* php_zip_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ { ze_zip_object *obj; zval tmp_member; @@ -306,7 +302,7 @@ } if (ret == SUCCESS) { - ret = zip_property_reader(obj, hnd, &retval TSRMLS_CC); + ret = php_zip_property_reader(obj, hnd, &retval TSRMLS_CC); if (ret == SUCCESS) { /* ensure we're creating a temporary variable */ retval->refcount = 0; @@ -325,8 +321,7 @@ } /* }}} */ -/* {{{ zip_object_free_storage */ -static void zip_object_free_storage(void *object TSRMLS_DC) +static void php_zip_object_free_storage(void *object TSRMLS_DC) /* {{{ */ { ze_zip_object * intern = (ze_zip_object *) object; int i; @@ -358,8 +353,7 @@ } /* }}} */ -/* {{{ zip_object_new */ -PHP_ZIP_API zend_object_value zip_object_new(zend_class_entry *class_type TSRMLS_DC) +PHP_ZIP_API zend_object_value php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { ze_zip_object *intern; zval *tmp; @@ -382,7 +376,7 @@ retval.handle = zend_objects_store_put(intern, NULL, - (zend_objects_free_object_storage_t) zip_object_free_storage, + (zend_objects_free_object_storage_t) php_zip_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) & zip_object_handlers; @@ -395,8 +389,6 @@ PHP_MINIT_FUNCTION(zip); PHP_MSHUTDOWN_FUNCTION(zip); PHP_MINFO_FUNCTION(zip); - -static int le_zip; /* }}} */ /* {{{ zip_module_entry @@ -419,13 +411,6 @@ ZEND_GET_MODULE(zip) #endif -/* {{{ zip_objects_clone */ -void zip_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - /* TODO */ -} -/* }}} */ - /* {{{ proto resource open(resource zip, string source) Create new zip using source uri for output */ PHP_METHOD(zip, open) @@ -503,7 +488,6 @@ int filename_len; char *entry_name = NULL; int entry_name_len = 0; - ze_zip_object ze_obj; struct zip_source *zs; int offset_start = 0, offset_len = 0; @@ -547,7 +531,7 @@ { struct zip *intern; zval *this = getThis(); - char *buffer, *buffer_cpy, *name; + char *buffer, *name; int buffer_len, name_len; ze_zip_object *ze_obj; struct zip_source *zs; @@ -598,7 +582,6 @@ char *name; int name_len; long flags; - ze_zip_object *ze_obj; struct zip_stat sb; if (!this) { @@ -631,7 +614,6 @@ struct zip *intern; zval *this = getThis(); long flags, index; - ze_zip_object *ze_obj; struct zip_stat sb; @@ -660,7 +642,6 @@ { struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; long index; @@ -691,7 +672,6 @@ { struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; char *new_name; int new_name_len; @@ -735,15 +715,13 @@ struct zip *intern; zval *this = getThis(); - ze_zip_object *ze_obj; zval *zval_files = NULL; zval **zval_file = NULL; php_stream_statbuf ssb; char *pathto; char *file; int pathto_len; - int ret, len, i; - char *fullpath; + int ret, i; int nelems; @@ -773,7 +751,7 @@ switch (Z_TYPE_P(zval_files)) { case IS_STRING: file = Z_STRVAL_P(zval_files); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } break; @@ -789,7 +767,7 @@ break; case IS_STRING: file = Z_STRVAL_PP(zval_file); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } break; @@ -812,8 +790,8 @@ } for (i = 0; i < filecount; i++) { - file = zip_get_name(intern, i, ZIP_FL_UNCHANGED); - if (!zip_extract_file(intern, pathto, file TSRMLS_CC)) { + file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); + if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) { RETURN_FALSE; } } @@ -887,17 +865,17 @@ zip_object_handlers.get_property_ptr_ptr = NULL; zip_object_handlers.write_property = NULL; - zip_object_handlers.read_property = zip_read_property; + zip_object_handlers.read_property = php_zip_read_property; INIT_CLASS_ENTRY(ce, "Zip", zip_class_functions); - ce.create_object = zip_object_new; + ce.create_object = php_zip_object_new; zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC); zend_hash_init(&zip_prop_handlers, 0, NULL, NULL, 1); - zip_register_prop_handler(&zip_prop_handlers, "status", zip_status, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "statusSys", zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "numFiles", zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC); - zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, zipobj_get_filename, IS_STRING TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC); + php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC); REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE); REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL); @@ -955,10 +933,11 @@ */ PHP_MSHUTDOWN_FUNCTION(zip) { + zend_hash_destroy(&zip_prop_handlers); #if ZIP_USE_WRAPPER php_unregister_url_stream_wrapper("zip" TSRMLS_CC); - return SUCCESS; #endif + return SUCCESS; } /* }}} */ @@ -969,7 +948,7 @@ php_info_print_table_start(); { php_info_print_table_row(2, "Zip", "enabled"); - php_info_print_table_row(2, "$Id: php_zip.c,v 1.13 2006/02/24 00:38:45 pajoye Exp $", "enabled"); + php_info_print_table_row(2, "$Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $", "enabled"); php_info_print_table_row(2, "Libzip version", "0.6.1"); } php_info_print_table_end(); http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.h?r1=1.5&r2=1.6&diff_format=u Index: pecl/zip/php_zip.h diff -u pecl/zip/php_zip.h:1.5 pecl/zip/php_zip.h:1.6 --- pecl/zip/php_zip.h:1.5 Wed Jan 18 00:28:50 2006 +++ pecl/zip/php_zip.h Mon Feb 27 13:26:52 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zip.h,v 1.5 2006/01/18 00:28:50 fmk Exp $ */ +/* $Id: php_zip.h,v 1.6 2006/02/27 13:26:52 helly Exp $ */ #ifndef PHP_ZIP_H #define PHP_ZIP_H @@ -47,8 +47,6 @@ int filename_len; } ze_zip_object; -static void zip_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); - zend_class_entry *zip_class_entry_ce; php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);