diff options
author | Marcus Boerger <helly@php.net> | 2006-02-25 18:25:45 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-02-25 18:25:45 +0000 |
commit | 941b0651dc7f1f6ca4f5fc88acde4d2a50632445 (patch) | |
tree | 6844d272bcf6e76009b9830db727f799a5ee34bd /ext/reflection/php_reflection.c | |
parent | 611a6dece9c099829f0123dd5a55635218bbfc46 (diff) | |
download | php-git-941b0651dc7f1f6ca4f5fc88acde4d2a50632445.tar.gz |
- MFH: Function deprecation flag
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index fc0d1e710c..9fcd270bf7 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -671,6 +671,9 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry 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 @@ ZEND_METHOD(reflection_method, isStatic) } /* }}} */ +/* {{{ 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 @@ static zend_function_entry reflection_function_functions[] = { 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 @@ static zend_function_entry reflection_parameter_functions[] = { 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 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ 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); |