return module->version;
}
+ZEND_API void zend_declare_property(zend_class_entry *ce, char *name, int namelen, zval *property, int access_type)
+{
+ zend_property_info property_info;
+ HashTable *target_symbol_table;
+
+ if (!(access_type & ZEND_ACC_PPP_MASK)) {
+ access_type |= ZEND_ACC_PUBLIC;
+ }
+ if (access_type & ZEND_ACC_STATIC) {
+ target_symbol_table = ce->static_members;
+ } else {
+ target_symbol_table = &ce->default_properties;
+ }
+ switch (access_type & ZEND_ACC_PPP_MASK) {
+ case ZEND_ACC_PRIVATE: {
+ char *priv_name;
+ int priv_name_length;
+
+ mangle_property_name(&priv_name, &priv_name_length, ce->name, ce->name_length, name, namelen);
+ zend_hash_update(target_symbol_table, priv_name, priv_name_length+1, &property, sizeof(zval *), NULL);
+ property_info.name = priv_name;
+ property_info.name_length = priv_name_length;
+ }
+ break;
+ case ZEND_ACC_PROTECTED: {
+ char *prot_name;
+ int prot_name_length;
+
+ mangle_property_name(&prot_name, &prot_name_length, "*", 1, name, namelen);
+ zend_hash_update(target_symbol_table, prot_name, prot_name_length+1, &property, sizeof(zval *), NULL);
+ property_info.name = prot_name;
+ property_info.name_length = prot_name_length;
+ }
+ break;
+ case ZEND_ACC_PUBLIC:
+ zend_hash_update(target_symbol_table, name, namelen, &property, sizeof(zval *), NULL);
+ property_info.name = estrdup(name);
+ property_info.name_length = namelen;
+ break;
+ }
+ property_info.flags = access_type;
+ property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1);
+
+ zend_hash_update(&ce->properties_info, name, namelen + 1, &property_info, sizeof(zend_property_info), NULL);
+}
/*
* Local variables:
* tab-width: 4
ZEND_API ZEND_FUNCTION(display_disabled_function);
ZEND_API ZEND_FUNCTION(display_disabled_class);
+ZEND_API void zend_declare_property(zend_class_entry *ce, char *name, int namelen, zval *property, int access_type);
#if ZEND_DEBUG
#define CHECK_ZVAL_STRING(z) \
#define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \
ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), name, name_length, var, _refcount, _is_ref)
+#define ZEND_PRIVATE_PROPERTY(class_ptr, name, value) \
+{ \
+ char *_name = (name); \
+ int namelen = strlen(_name); \
+ zend_declare_property(class_ptr, _name, namelen, value, ZEND_ACC_PRIVATE); \
+}
+
+#define ZEND_PROTECTED_PROPERTY(class_ptr, name, value) \
+{ \
+ char *_name = (name); \
+ int namelen = strlen(_name); \
+ zend_declare_property(class_ptr, _name, namelen, value, ZEND_ACC_PROTECTED); \
+}
+
+#define ZEND_PUBLIC_PROPERTY(class_ptr, name, value) \
+{ \
+ char *_name = (name); \
+ int namelen = strlen(_name); \
+ zend_declare_property(class_ptr, _name, namelen, value, ZEND_ACC_PUBLIC); \
+}
+
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)