cvs: ZendEngine2 / zend_API.c zend_API.h zend_reflection_api.c

From: Date: Sat, 16 Aug 2003 20:46:22 +0000
Subject: cvs: ZendEngine2 / zend_API.c zend_API.h zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1635@lists.php.net to get a copy of this message
helly Sat Aug 16 16:46:22 2003 EDT Modified files: /ZendEngine2 zend_API.c zend_API.h zend_reflection_api.c Log: Simplify abstract method declaration Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.196 ZendEngine2/zend_API.c:1.197 --- ZendEngine2/zend_API.c:1.196 Wed Aug 13 03:02:44 2003 +++ ZendEngine2/zend_API.c Sat Aug 16 16:46:22 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.196 2003/08/13 07:02:44 helly Exp $ */ +/* $Id: zend_API.c,v 1.197 2003/08/16 20:46:22 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1185,7 +1185,7 @@ } else { internal_function->fn_flags = ZEND_ACC_PUBLIC; } - if (!internal_function->handler) { + if (!internal_function->handler && !(ptr->flags&ZEND_ACC_ABSTRACT)) { zend_error(error_type, "Null function defined as active function"); zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); return FAILURE; Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.150 ZendEngine2/zend_API.h:1.151 --- ZendEngine2/zend_API.h:1.150 Tue Aug 5 06:24:40 2003 +++ ZendEngine2/zend_API.h Sat Aug 16 16:46:22 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.150 2003/08/05 10:24:40 zeev Exp $ */ +/* $Id: zend_API.h,v 1.151 2003/08/16 20:46:22 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -50,6 +50,7 @@ #define ZEND_FE(name, arg_info) ZEND_NAMED_FE(name, ZEND_FN(name), arg_info) #define ZEND_FALIAS(name, alias, arg_info) ZEND_NAMED_FE(name, ZEND_FN(alias), arg_info) #define ZEND_ME(classname, name, arg_info, flags) { #name, ZEND_FN(classname##_##name), arg_info, sizeof(arg_info)/sizeof(struct _zend_arg_info)-1, flags }, +#define ZEND_ABSTRACT_ME(classname, name, arg_info) { #name, NULL, arg_info, sizeof(arg_info)/sizeof(struct _zend_arg_info)-1, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT }, #define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref }, #define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, pass_by_ref }, Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.22 ZendEngine2/zend_reflection_api.c:1.23 --- ZendEngine2/zend_reflection_api.c:1.22 Tue Aug 5 06:24:40 2003 +++ ZendEngine2/zend_reflection_api.c Sat Aug 16 16:46:22 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.22 2003/08/05 10:24:40 zeev Exp $ */ +/* $Id: zend_reflection_api.c,v 1.23 2003/08/16 20:46:22 helly Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_default_classes.h" @@ -2171,7 +2171,7 @@ }; static zend_function_entry reflector_functions[] = { - ZEND_NAMED_FE(tostring, ZEND_FN(reflector_tostring), NULL) + ZEND_ABSTRACT_ME(reflector, tostring, NULL) {NULL, NULL, NULL} }; @@ -2266,7 +2266,6 @@ ZEND_API void zend_register_reflection_api(TSRMLS_D) { zend_class_entry _reflection_entry; - zend_function *mptr; memcpy(&reflection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); @@ -2276,11 +2275,6 @@ INIT_CLASS_ENTRY(_reflection_entry, "reflector", reflector_functions); reflector_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); reflector_ptr->ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; - - /* Ugly... is there a better way to introduce an abstract method to a class? */ - if (zend_hash_find(&reflector_ptr->function_table, "tostring", sizeof("tostring"), (void **) &mptr) == SUCCESS) { - mptr->common.fn_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_PUBLIC; - } INIT_CLASS_ENTRY(_reflection_entry, "reflection_function", reflection_function_functions); _reflection_entry.create_object = reflection_objects_new;

« previous php.zend-engine.cvs (#1635) next »