From: Marcus Boerger Date: Wed, 31 Dec 2008 12:26:33 +0000 (+0000) Subject: - MFH Move stdClass registering where it should be X-Git-Tag: php-5.3.0beta1~336 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63d00f7006f07b8f87ee01e62e1632b18d5ef2cf;p=php - MFH Move stdClass registering where it should be --- diff --git a/Zend/zend.c b/Zend/zend.c index b450201eeb..5e76ca453a 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -432,20 +432,6 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_ } /* }}} */ -static void register_standard_class(TSRMLS_D) /* {{{ */ -{ - zend_standard_class_def = calloc(1, sizeof(zend_class_entry)); - - zend_standard_class_def->type = ZEND_INTERNAL_CLASS; - zend_standard_class_def->name_length = sizeof("stdClass") - 1; - zend_standard_class_def->name = zend_strndup("stdClass", zend_standard_class_def->name_length); - zend_initialize_class_data(zend_standard_class_def, 1 TSRMLS_CC); - - zend_hash_add(CG(class_table), "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry *), NULL); - zend_standard_class_def->module = EG(current_module); -} -/* }}} */ - #ifdef ZTS static zend_bool asp_tags_default = 0; static zend_bool short_tags_default = 1; @@ -703,7 +689,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i zend_startup_builtin_functions(TSRMLS_C); } - register_standard_class(TSRMLS_C); zend_register_standard_constants(TSRMLS_C); zend_register_auto_global("GLOBALS", sizeof("GLOBALS") - 1, NULL TSRMLS_CC); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index e29195df77..46d25d25a8 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -286,11 +286,21 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */ }; /* }}} */ +ZEND_MINIT_FUNCTION(core) { /* {{{ */ + zend_class_entry class_entry; + + INIT_CLASS_ENTRY(class_entry, "stdClass", NULL); + zend_standard_class_def = zend_register_internal_class(&class_entry TSRMLS_CC); + + return SUCCESS; +} +/* }}} */ + zend_module_entry zend_builtin_module = { /* {{{ */ STANDARD_MODULE_HEADER, "Core", builtin_functions, - NULL, + ZEND_MINIT(core), NULL, NULL, NULL,