]> granicus.if.org Git - php/commitdiff
we can no longer register internal-classes once the script is started.
authorThies C. Arntzen <thies@php.net>
Mon, 6 Aug 2001 13:36:08 +0000 (13:36 +0000)
committerThies C. Arntzen <thies@php.net>
Mon, 6 Aug 2001 13:36:08 +0000 (13:36 +0000)
therefore the "incomplete class" is now registered at MINIT time.

ext/standard/basic_functions.c
ext/standard/incomplete_class.c
ext/standard/php_incomplete_class.h
ext/standard/var.c
ext/wddx/wddx.c

index cc19b0dfaa0b9929ea83d0b07a1d77ef424cb5ec..5bd25d7171417977526f7ce3255f5743287af6c5 100644 (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
index 44470006f195d8726989c438e4a151fd376a5d98..246e8d556c1e09ece7d58e550f79bd7cce16816b 100644 (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);
 }
 /* }}} */
 
index 7d294f519d8f67b37f574b171544dc1c0ee4eadd..47d54b7b048ae9ecaa48286dd8ddd958c7d52445 100644 (file)
 #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)) {                                         \
index a47231f36fba0890b7604f96f692fe0825517a9c..66e9625f60c4dbc2f5478c90e57de394d519aa24 100644 (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;
index 204f0432019abe12d632cac9cac0215f0bf61536..36328879ee36b75f7c4b71614d8cf1a2cf58f5b4 100644 (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 */