cvs: ZendEngine2 / zend_interfaces.c

From: Date: Tue, 01 Mar 2005 23:41:49 +0000
Subject: cvs: ZendEngine2 / zend_interfaces.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3449@lists.php.net to get a copy of this message
helly Tue Mar 1 18:41:49 2005 EDT Modified files: /ZendEngine2 zend_interfaces.c Log: - Support statuc methods/functions http://cvs.php.net/diff.php/ZendEngine2/zend_interfaces.c?r1=1.26&r2=1.27&ty=u Index: ZendEngine2/zend_interfaces.c diff -u ZendEngine2/zend_interfaces.c:1.26 ZendEngine2/zend_interfaces.c:1.27 --- ZendEngine2/zend_interfaces.c:1.26 Tue Feb 22 20:09:10 2005 +++ ZendEngine2/zend_interfaces.c Tue Mar 1 18:41:49 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_interfaces.c,v 1.26 2005/02/23 01:09:10 helly Exp $ */ +/* $Id: zend_interfaces.c,v 1.27 2005/03/01 23:41:49 helly Exp $ */ #include "zend.h" #include "zend_API.h" @@ -36,6 +36,7 @@ zend_fcall_info fci; zval z_fname; zval *retval; + HashTable *function_table; zval **params[2]; @@ -62,12 +63,17 @@ fcic.initialized = 1; if (!obj_ce) { - obj_ce = Z_OBJCE_PP(object_pp); + obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; + } + if (obj_ce) { + function_table = &obj_ce->function_table; + } else { + function_table = EG(function_table); } if (!fn_proxy || !*fn_proxy) { - if (zend_hash_find(&obj_ce->function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { + if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s::%s", obj_ce->name, function_name); + zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); } if (fn_proxy) { *fn_proxy = fcic.function_handler; @@ -82,9 +88,9 @@ if (result == FAILURE) { /* error at c-level */ if (!obj_ce) { - obj_ce = Z_OBJCE_PP(object_pp); + obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; } - zend_error(E_CORE_ERROR, "Couldn't execute method %s::%s", obj_ce->name, function_name); + zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); } if (!retval_ptr_ptr) { if (retval) {

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