we can no longer register internal-classes once the script is started.

therefore the "incomplete class" is now registered at MINIT time.
This commit is contained in:
Thies C. Arntzen 2001-08-06 13:36:08 +00:00
parent 89a8b0144c
commit a35df189b8
5 changed files with 7 additions and 10 deletions

View File

@ -26,6 +26,7 @@
#include "internal_functions_registry.h"
#include "php_standard.h"
#include "php_math.h"
#include "php_incomplete_class.h"
#include "ext/standard/info.h"
#include "zend_operators.h"
#include <stdarg.h>
@ -722,6 +723,8 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC)
#ifdef PHP_WIN32
CoInitialize(NULL);
#endif
BG(incomplete_class) = php_create_incomplete_class(TSRMLS_C);
}
static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC)
@ -797,6 +800,7 @@ PHP_MINIT_FUNCTION(basic)
PHP_MINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
#endif
if(PG(allow_url_fopen)) {
if (FAILURE==php_register_url_wrapper("http", php_fopen_url_wrap_http TSRMLS_CC)) {
return FAILURE;
@ -853,7 +857,6 @@ PHP_RINIT_FUNCTION(basic)
BG(locale_string) = NULL;
BG(user_compare_func_name) = NULL;
BG(array_walk_func_name) = NULL;
BG(incomplete_class) = NULL;
#ifdef HAVE_MMAP
BG(mmap_file) = NULL;
#endif

View File

@ -97,9 +97,7 @@ zend_class_entry *php_create_incomplete_class(TSRMLS_D)
incomplete_class_get_property,
incomplete_class_set_property);
BG(incomplete_class) = zend_register_internal_class(&incomplete_class TSRMLS_CC);
return (BG(incomplete_class));
return zend_register_internal_class(&incomplete_class TSRMLS_CC);
}
/* }}} */

View File

@ -26,10 +26,6 @@
#define PHP_IC_ENTRY \
BG(incomplete_class)
#define PHP_IC_ENTRY_READ \
(PHP_IC_ENTRY ? PHP_IC_ENTRY : php_create_incomplete_class(TSRMLS_C))
#define PHP_SET_CLASS_ATTRIBUTES(struc) \
/* OBJECTS_FIXME: Fix for new object model */ \
if (Z_OBJCE_P(struc) == BG(incomplete_class)) { \

View File

@ -525,7 +525,7 @@ PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, Has
if (zend_hash_find(EG(class_table), class_name, i+1, (void **) &ce)==FAILURE) {
incomplete_class = 1;
ce = PHP_IC_ENTRY_READ;
ce = PHP_IC_ENTRY;
}
} else { /* old php 3.0 data 'o' */
ce = &zend_standard_class_def;

View File

@ -836,7 +836,7 @@ static void php_wddx_pop_element(void *user_data, const char *name)
if (zend_hash_find(EG(class_table), Z_STRVAL_P(ent1->data),
Z_STRLEN_P(ent1->data)+1, (void **) &ce)==FAILURE) {
incomplete_class = 1;
ce = PHP_IC_ENTRY_READ;
ce = PHP_IC_ENTRY;
}
/* Initialize target object */