scottmac Mon Dec 22 16:44:51 2008 UTC Modified files: /php-src/ext/fileinfo fileinfo.c Log: Remove all of the stuff we have in here for pre PHP 5.2 support and memset the fileinfo struct. http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.40&r2=1.41&diff_format=u Index: php-src/ext/fileinfo/fileinfo.c diff -u php-src/ext/fileinfo/fileinfo.c:1.40 php-src/ext/fileinfo/fileinfo.c:1.41 --- php-src/ext/fileinfo/fileinfo.c:1.40 Mon Nov 17 11:26:20 2008 +++ php-src/ext/fileinfo/fileinfo.c Mon Dec 22 16:44:51 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fileinfo.c,v 1.40 2008/11/17 11:26:20 felipe Exp $ */ +/* $Id: fileinfo.c,v 1.41 2008/12/22 16:44:51 scottmac Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -48,8 +48,6 @@ struct magic_set *magic; }; -#ifdef ZEND_ENGINE_2 -/* {{{ */ static zend_object_handlers finfo_object_handlers; zend_class_entry *finfo_class_entry; @@ -103,6 +101,7 @@ zval *tmp; intern = emalloc(sizeof(struct finfo_object)); + memset(intern, 0, sizeof(struct finfo_object)); zend_object_std_init(&intern->zo, class_type TSRMLS_CC); zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); @@ -169,33 +168,14 @@ /* {{{ finfo_class_functions */ function_entry finfo_class_functions[] = { -#if PHP_VERSION_ID >= 50200 ZEND_ME_MAPPING(finfo, finfo_open, arginfo_finfo_open, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(set_flags, finfo_set_flags,arginfo_finfo_method_set_flags, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(file, finfo_file, arginfo_finfo_method_file, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(buffer, finfo_buffer, arginfo_finfo_method_buffer, ZEND_ACC_PUBLIC) -#else - ZEND_ME_MAPPING(finfo, finfo_open, arginfo_finfo_open) - ZEND_ME_MAPPING(set_flags, finfo_set_flags,arginfo_finfo_method_set_flags) - ZEND_ME_MAPPING(file, finfo_file, arginfo_finfo_method_file) - ZEND_ME_MAPPING(buffer, finfo_buffer, arginfo_finfo_method_buffer) -#endif {NULL, NULL, NULL} }; /* }}} */ -/* }}} */ -#else -/* {{{ */ -#define FILEINFO_REGISTER_OBJECT(_object, _ptr) {} -#define FILEINFO_FROM_OBJECT(socket_id, object) {} - -#define FILEINFO_DECLARE_INIT_OBJECT(object) -#define object 0 - -/* }}} */ -#endif /* ZEND_ENGINE_2 */ - #define FINFO_SET_OPTION(magic, options) \ if (magic_setflags(magic, options) == -1) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%ld' %d:%s", \ @@ -236,7 +216,6 @@ */ PHP_MINIT_FUNCTION(finfo) { -#ifdef ZEND_ENGINE_2 zend_class_entry _finfo_class_entry; INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions); _finfo_class_entry.create_object = finfo_objects_new; @@ -244,7 +223,6 @@ /* copy the standard object handlers to you handler table */ memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -#endif /* ZEND_ENGINE_2 */ le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number); @@ -268,9 +246,7 @@ /* {{{ fileinfo_module_entry */ zend_module_entry fileinfo_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, -#endif "fileinfo", fileinfo_functions, PHP_MINIT(finfo), @@ -278,9 +254,7 @@ NULL, NULL, PHP_MINFO(fileinfo), -#if ZEND_MODULE_API_NO >= 20010901 PHP_FILEINFO_VERSION, -#endif STANDARD_MODULE_PROPERTIES }; /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php