GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable));
- GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
HashTable *static_members;
HashTable constants_table;
zend_function_entry *builtin_functions;
- struct _zend_class_entry *ns;
union _zend_function *constructor;
union _zend_function *destructor;
return module->version;
}
-ZEND_API void zend_make_full_classname(zend_class_entry *ce, char **name, zend_uint *name_len)
-{
- int len = ce->name_length;
- char *full_name;
-
- if(ce->ns && ce->ns->name) {
- len += ce->ns->name_length + 2;
- }
-
- *name = full_name = emalloc(len+1);
- *name_len = len;
-
- if(ce->ns && ce->ns->name) {
- memcpy(full_name, ce->ns->name, ce->ns->name_length);
- full_name += ce->ns->name_length;
- *(full_name++) = ':';
- *(full_name++) = ':';
- }
-
- memcpy(full_name, ce->name, ce->name_length);
- full_name[ce->name_length] = '\0';
-}
-
/*
* Local variables:
* tab-width: 4
ZEND_API ZEND_FUNCTION(display_disabled_function);
ZEND_API ZEND_FUNCTION(display_disabled_class);
-ZEND_API void zend_make_full_classname(zend_class_entry *ce, char **name, zend_uint *name_len);
-
#if ZEND_DEBUG
#define CHECK_ZVAL_STRING(z) \
if ((z)->value.str.val[ (z)->value.str.len ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", (z)->value.str.val); }
RETURN_FALSE;
}
- if(ce->ns) {
- zend_make_full_classname(ce, &name, &name_len);
- RETURN_STRINGL(name, name_len, 0);
- } else {
- RETURN_STRINGL(ce->name, ce->name_length, 1);
- }
+ RETURN_STRINGL(ce->name, ce->name_length, 1);
}
RETURN_STRINGL(name, name_len, 0);
&& Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_length, 1 TSRMLS_CC) == SUCCESS) {
RETURN_STRINGL(name, name_length, 0);
} else if (Z_OBJ_HT_PP(arg)->get_class_entry && (ce = zend_get_class_entry(*arg TSRMLS_CC))) {
- zend_make_full_classname(ce, &name, &name_length);
- RETURN_STRINGL(name, name_length, 0);
+ RETURN_STRINGL(ce->name, ce->name_length, 1);
} else {
RETURN_FALSE;
}
}
if (ce && ce->parent) {
- zend_make_full_classname(ce->parent, &name, &name_length);
- RETURN_STRINGL(name, name_length, 0);
+ RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1);
} else {
RETURN_FALSE;
}
ce = zobj->ce;
}
- zend_make_full_classname(ce, class_name, class_name_len);
+ *class_name_len = ce->name_length;
+ *class_name = estrndup(ce->name, ce->name_length);
return SUCCESS;
}