cvs: Zend(PHP_4_3) / zend_API.c zend_API.h

From: Date: Mon, 03 Mar 2003 01:53:46 +0000
Subject: cvs: Zend(PHP_4_3) / zend_API.c zend_API.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-986@lists.php.net to get a copy of this message
phanto Sun Mar 2 20:53:46 2003 EDT Modified files: (Branch: PHP_4_3) /Zend zend_API.c zend_API.h Log: MFZE2: adding zend_disable_class thanks to George again Index: Zend/zend_API.c diff -u Zend/zend_API.c:1.113.2.2 Zend/zend_API.c:1.113.2.3 --- Zend/zend_API.c:1.113.2.2 Thu Feb 27 10:10:38 2003 +++ Zend/zend_API.c Sun Mar 2 20:53:46 2003 @@ -1288,6 +1288,27 @@ return zend_register_functions(disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC); } +static zend_function_entry disabled_class_functions[] = { + ZEND_FE(display_disabled_function, NULL) + { NULL, NULL, NULL } +}; + +ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) +{ + zend_class_entry zce; + + zend_str_tolower(class_name, class_name_length); + if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { + return FAILURE; + } + + disabled_class_functions[0].fname = class_name; + INIT_CLASS_ENTRY(zce, class_name, disabled_class_functions); + zend_register_internal_class(&zce TSRMLS_CC); + + return SUCCESS; +} + zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name) { char *lcname; Index: Zend/zend_API.h diff -u Zend/zend_API.h:1.113.2.1 Zend/zend_API.h:1.113.2.2 --- Zend/zend_API.h:1.113.2.1 Tue Dec 31 11:22:57 2002 +++ Zend/zend_API.h Sun Mar 2 20:53:46 2003 @@ -137,6 +137,7 @@ ZEND_API zend_module_entry *zend_get_module(int module_number); ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC); +ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC); ZEND_API void zend_wrong_param_count(TSRMLS_D); ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);

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