cvs: ZendEngine2(PHP_5_1) / zend_API.c zend_API.h zend_compile.h zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src/ext/reflection
php_reflection.c php-src/main php.h
| From: | Marcus Boerger | Date: | Sat, 25 Feb 2006 18:25:46 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_1) / zend_API.c zend_API.h zend_compile.h zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src/ext/reflection php_reflection.c php-src/main php.h |
||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4622@lists.php.net to get a copy of this message | ||
helly Sat Feb 25 18:25:46 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/main php.h
/php-src/ext/reflection php_reflection.c
/ZendEngine2 zend_API.c zend_API.h zend_compile.h
zend_execute_API.c zend_vm_def.h zend_vm_execute.h
Log:
- MFH: Function deprecation flag
http://cvs.php.net/viewcvs.cgi/php-src/main/php.h?r1=1.221.2.2&r2=1.221.2.3&diff_format=u Index: php-src/main/php.h diff -u php-src/main/php.h:1.221.2.2 php-src/main/php.h:1.221.2.3 --- php-src/main/php.h:1.221.2.2 Sun Jan 1 12:50:17 2006 +++ php-src/main/php.h Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.221.2.2 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: php.h,v 1.221.2.3 2006/02/25 18:25:44 helly Exp $ */ #ifndef PHP_H #define PHP_H @@ -340,7 +340,9 @@ #define PHP_NAMED_FE ZEND_NAMED_FE #define PHP_FE ZEND_FE +#define PHP_DEP_FE ZEND_DEP_FE #define PHP_FALIAS ZEND_FALIAS +#define PHP_DEP_FALIAS ZEND_DEP_FALIAS #define PHP_ME ZEND_ME #define PHP_MALIAS ZEND_MALIAS #define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.26&r2=1.164.2.27&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.26 php-src/ext/reflection/php_reflection.c:1.164.2.27 --- php-src/ext/reflection/php_reflection.c:1.164.2.26 Fri Feb 24 23:09:22 2006 +++ php-src/ext/reflection/php_reflection.c Sat Feb 25 18:25:44 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.26 2006/02/24 23:09:22 johannes Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.27 2006/02/25 18:25:44 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -671,6 +671,9 @@ string_printf(str, fptr->common.scope ? "%sMethod [ " : "%sFunction [ ", indent); string_printf(str, (fptr->type == ZEND_USER_FUNCTION) ? "<user" : "<internal"); + if (fptr->common.fn_flags & ZEND_ACC_DEPRECATED) { + string_printf(str, ", deprecated"); + } #if MBO_0 if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function*)fptr)->module) { string_printf(str, ":%s", ((zend_internal_function*)fptr)->module->name); @@ -2366,6 +2369,14 @@ } /* }}} */ +/* {{{ proto public bool ReflectionFunction::isDeprecated() + Returns whether this function is deprecated */ +ZEND_METHOD(reflection_function, isDeprecated) +{ + _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_DEPRECATED); +} +/* }}} */ + /* {{{ proto public bool ReflectionMethod::isConstructor() Returns whether this method is the constructor */ ZEND_METHOD(reflection_method, isConstructor) @@ -4097,6 +4108,7 @@ ZEND_ME(reflection_function, getExtension, NULL, 0) ZEND_ME(reflection_function, getExtensionName, NULL, 0) #endif + ZEND_ME(reflection_function, isDeprecated, NULL, 0) {NULL, NULL, NULL} }; @@ -4197,7 +4209,7 @@ ZEND_ME(reflection_parameter, getName, NULL, 0) ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0) ZEND_ME(reflection_parameter, getDeclaringClass, NULL, 0) - ZEND_MALIAS(reflection_parameter, getClass, getDeclaringClass, NULL, 0) + ZEND_MALIAS(reflection_parameter, getClass, getDeclaringClass, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ZEND_ME(reflection_parameter, isArray, NULL, 0) ZEND_ME(reflection_parameter, allowsNull, NULL, 0) ZEND_ME(reflection_parameter, isOptional, NULL, 0) @@ -4271,6 +4283,8 @@ reflection_register_implement(reflection_function_ptr, reflector_ptr TSRMLS_CC); zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); + REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED); + INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions); _reflection_entry.create_object = reflection_objects_new; reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); @@ -4330,7 +4344,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.26 2006/02/24 23:09:22 johannes Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.27 2006/02/25 18:25:44 helly Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.296.2.20&r2=1.296.2.21&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.296.2.20 ZendEngine2/zend_API.c:1.296.2.21 --- ZendEngine2/zend_API.c:1.296.2.20 Sun Feb 19 10:39:31 2006 +++ ZendEngine2/zend_API.c Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.296.2.20 2006/02/19 10:39:31 helly Exp $ */ +/* $Id: zend_API.c,v 1.296.2.21 2006/02/25 18:25:44 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1554,7 +1554,9 @@ } if (ptr->flags) { if (!(ptr->flags & ZEND_ACC_PPP_MASK)) { - zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname); + if (ptr->flags != ZEND_ACC_DEPRECATED || scope) { + zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname); + } internal_function->fn_flags = ZEND_ACC_PUBLIC | ptr->flags; } else { internal_function->fn_flags = ptr->flags; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.h?r1=1.207.2.6&r2=1.207.2.7&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.207.2.6 ZendEngine2/zend_API.h:1.207.2.7 --- ZendEngine2/zend_API.h:1.207.2.6 Wed Jan 4 23:53:03 2006 +++ ZendEngine2/zend_API.h Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.207.2.6 2006/01/04 23:53:03 andi Exp $ */ +/* $Id: zend_API.h,v 1.207.2.7 2006/02/25 18:25:44 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -50,7 +50,9 @@ #define ZEND_NAMED_FE(zend_name, name, arg_info) ZEND_FENTRY(zend_name, name, arg_info, 0) #define ZEND_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, 0) +#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED) #define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0) +#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED) #define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags) #define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) #define ZEND_MALIAS(classname, name, alias, arg_info, flags) \ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.h?r1=1.316.2.6&r2=1.316.2.7&diff_format=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.316.2.6 ZendEngine2/zend_compile.h:1.316.2.7 --- ZendEngine2/zend_compile.h:1.316.2.6 Wed Jan 4 23:53:04 2006 +++ ZendEngine2/zend_compile.h Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.316.2.6 2006/01/04 23:53:04 andi Exp $ */ +/* $Id: zend_compile.h,v 1.316.2.7 2006/02/25 18:25:44 helly Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -136,6 +136,9 @@ /* shadow of parent's private method/property */ #define ZEND_ACC_SHADOW 0x20000 +/* deprecation flag */ +#define ZEND_ACC_DEPRECATED 0x40000 + char *zend_visibility_string(zend_uint fn_flags); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.13&r2=1.331.2.14&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.13 ZendEngine2/zend_execute_API.c:1.331.2.14 --- ZendEngine2/zend_execute_API.c:1.331.2.13 Sun Jan 22 22:14:32 2006 +++ ZendEngine2/zend_execute_API.c Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331.2.13 2006/01/22 22:14:32 helly Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.14 2006/02/25 18:25:44 helly Exp $ */ #include <stdio.h> #include <signal.h> @@ -803,6 +803,18 @@ calling_scope = fci_cache->calling_scope; fci->object_pp = fci_cache->object_pp; } + + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + } + } for (i=0; i<fci->param_count; i++) { zval *param; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.23&r2=1.59.2.24&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.59.2.23 ZendEngine2/zend_vm_def.h:1.59.2.24 --- ZendEngine2/zend_vm_def.h:1.59.2.23 Mon Feb 6 11:45:55 2006 +++ ZendEngine2/zend_vm_def.h Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.59.2.23 2006/02/06 11:45:55 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.59.2.24 2006/02/25 18:25:44 helly Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -1784,9 +1784,17 @@ zend_bool should_change_scope; zend_op *ctor_opline; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + }; } zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.24&r2=1.62.2.25&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.62.2.24 ZendEngine2/zend_vm_execute.h:1.62.2.25 --- ZendEngine2/zend_vm_execute.h:1.62.2.24 Mon Feb 6 11:45:56 2006 +++ ZendEngine2/zend_vm_execute.h Sat Feb 25 18:25:45 2006 @@ -132,9 +132,17 @@ zend_bool should_change_scope; zend_op *ctor_opline; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + }; } zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);
http://cvs.php.net/viewcvs.cgi/php-src/main/php.h?r1=1.221.2.2&r2=1.221.2.3&diff_format=u Index: php-src/main/php.h diff -u php-src/main/php.h:1.221.2.2 php-src/main/php.h:1.221.2.3 --- php-src/main/php.h:1.221.2.2 Sun Jan 1 12:50:17 2006 +++ php-src/main/php.h Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.221.2.2 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: php.h,v 1.221.2.3 2006/02/25 18:25:44 helly Exp $ */ #ifndef PHP_H #define PHP_H @@ -340,7 +340,9 @@ #define PHP_NAMED_FE ZEND_NAMED_FE #define PHP_FE ZEND_FE +#define PHP_DEP_FE ZEND_DEP_FE #define PHP_FALIAS ZEND_FALIAS +#define PHP_DEP_FALIAS ZEND_DEP_FALIAS #define PHP_ME ZEND_ME #define PHP_MALIAS ZEND_MALIAS #define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.26&r2=1.164.2.27&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.26 php-src/ext/reflection/php_reflection.c:1.164.2.27 --- php-src/ext/reflection/php_reflection.c:1.164.2.26 Fri Feb 24 23:09:22 2006 +++ php-src/ext/reflection/php_reflection.c Sat Feb 25 18:25:44 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.26 2006/02/24 23:09:22 johannes Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.27 2006/02/25 18:25:44 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -671,6 +671,9 @@ string_printf(str, fptr->common.scope ? "%sMethod [ " : "%sFunction [ ", indent); string_printf(str, (fptr->type == ZEND_USER_FUNCTION) ? "<user" : "<internal"); + if (fptr->common.fn_flags & ZEND_ACC_DEPRECATED) { + string_printf(str, ", deprecated"); + } #if MBO_0 if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function*)fptr)->module) { string_printf(str, ":%s", ((zend_internal_function*)fptr)->module->name); @@ -2366,6 +2369,14 @@ } /* }}} */ +/* {{{ proto public bool ReflectionFunction::isDeprecated() + Returns whether this function is deprecated */ +ZEND_METHOD(reflection_function, isDeprecated) +{ + _function_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_DEPRECATED); +} +/* }}} */ + /* {{{ proto public bool ReflectionMethod::isConstructor() Returns whether this method is the constructor */ ZEND_METHOD(reflection_method, isConstructor) @@ -4097,6 +4108,7 @@ ZEND_ME(reflection_function, getExtension, NULL, 0) ZEND_ME(reflection_function, getExtensionName, NULL, 0) #endif + ZEND_ME(reflection_function, isDeprecated, NULL, 0) {NULL, NULL, NULL} }; @@ -4197,7 +4209,7 @@ ZEND_ME(reflection_parameter, getName, NULL, 0) ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0) ZEND_ME(reflection_parameter, getDeclaringClass, NULL, 0) - ZEND_MALIAS(reflection_parameter, getClass, getDeclaringClass, NULL, 0) + ZEND_MALIAS(reflection_parameter, getClass, getDeclaringClass, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ZEND_ME(reflection_parameter, isArray, NULL, 0) ZEND_ME(reflection_parameter, allowsNull, NULL, 0) ZEND_ME(reflection_parameter, isOptional, NULL, 0) @@ -4271,6 +4283,8 @@ reflection_register_implement(reflection_function_ptr, reflector_ptr TSRMLS_CC); zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); + REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED); + INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions); _reflection_entry.create_object = reflection_objects_new; reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); @@ -4330,7 +4344,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.26 2006/02/24 23:09:22 johannes Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.27 2006/02/25 18:25:44 helly Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.296.2.20&r2=1.296.2.21&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.296.2.20 ZendEngine2/zend_API.c:1.296.2.21 --- ZendEngine2/zend_API.c:1.296.2.20 Sun Feb 19 10:39:31 2006 +++ ZendEngine2/zend_API.c Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.296.2.20 2006/02/19 10:39:31 helly Exp $ */ +/* $Id: zend_API.c,v 1.296.2.21 2006/02/25 18:25:44 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1554,7 +1554,9 @@ } if (ptr->flags) { if (!(ptr->flags & ZEND_ACC_PPP_MASK)) { - zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname); + if (ptr->flags != ZEND_ACC_DEPRECATED || scope) { + zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname); + } internal_function->fn_flags = ZEND_ACC_PUBLIC | ptr->flags; } else { internal_function->fn_flags = ptr->flags; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.h?r1=1.207.2.6&r2=1.207.2.7&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.207.2.6 ZendEngine2/zend_API.h:1.207.2.7 --- ZendEngine2/zend_API.h:1.207.2.6 Wed Jan 4 23:53:03 2006 +++ ZendEngine2/zend_API.h Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.207.2.6 2006/01/04 23:53:03 andi Exp $ */ +/* $Id: zend_API.h,v 1.207.2.7 2006/02/25 18:25:44 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -50,7 +50,9 @@ #define ZEND_NAMED_FE(zend_name, name, arg_info) ZEND_FENTRY(zend_name, name, arg_info, 0) #define ZEND_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, 0) +#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED) #define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0) +#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED) #define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags) #define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) #define ZEND_MALIAS(classname, name, alias, arg_info, flags) \ http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.h?r1=1.316.2.6&r2=1.316.2.7&diff_format=u Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.316.2.6 ZendEngine2/zend_compile.h:1.316.2.7 --- ZendEngine2/zend_compile.h:1.316.2.6 Wed Jan 4 23:53:04 2006 +++ ZendEngine2/zend_compile.h Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.316.2.6 2006/01/04 23:53:04 andi Exp $ */ +/* $Id: zend_compile.h,v 1.316.2.7 2006/02/25 18:25:44 helly Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -136,6 +136,9 @@ /* shadow of parent's private method/property */ #define ZEND_ACC_SHADOW 0x20000 +/* deprecation flag */ +#define ZEND_ACC_DEPRECATED 0x40000 + char *zend_visibility_string(zend_uint fn_flags); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.13&r2=1.331.2.14&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.13 ZendEngine2/zend_execute_API.c:1.331.2.14 --- ZendEngine2/zend_execute_API.c:1.331.2.13 Sun Jan 22 22:14:32 2006 +++ ZendEngine2/zend_execute_API.c Sat Feb 25 18:25:44 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331.2.13 2006/01/22 22:14:32 helly Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.14 2006/02/25 18:25:44 helly Exp $ */ #include <stdio.h> #include <signal.h> @@ -803,6 +803,18 @@ calling_scope = fci_cache->calling_scope; fci->object_pp = fci_cache->object_pp; } + + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + } + } for (i=0; i<fci->param_count; i++) { zval *param; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.23&r2=1.59.2.24&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.59.2.23 ZendEngine2/zend_vm_def.h:1.59.2.24 --- ZendEngine2/zend_vm_def.h:1.59.2.23 Mon Feb 6 11:45:55 2006 +++ ZendEngine2/zend_vm_def.h Sat Feb 25 18:25:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.59.2.23 2006/02/06 11:45:55 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.59.2.24 2006/02/25 18:25:44 helly Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -1784,9 +1784,17 @@ zend_bool should_change_scope; zend_op *ctor_opline; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + }; } zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.24&r2=1.62.2.25&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.62.2.24 ZendEngine2/zend_vm_execute.h:1.62.2.25 --- ZendEngine2/zend_vm_execute.h:1.62.2.24 Mon Feb 6 11:45:56 2006 +++ ZendEngine2/zend_vm_execute.h Sat Feb 25 18:25:45 2006 @@ -132,9 +132,17 @@ zend_bool should_change_scope; zend_op *ctor_opline; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { + if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ + } + if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { + zend_error(E_STRICT, "Function %s%s%s() is deprecated", + EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", + EX(function_state).function->common.scope ? "::" : "", + EX(function_state).function->common.function_name); + }; } zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);